{"openapi":"3.1.0","info":{"title":"Brain API","description":"Pioneer AI Brain System API","version":"2.0.0"},"paths":{"/feature-flags":{"get":{"tags":["feature-flags"],"summary":"Get Feature Flags","description":"Return resolved feature flags for the requesting user.\n\nUses ``FlexibleAuth`` (not ``get_current_user_with_client``) because the\nJWT path inside ``_authenticate_with_jwt`` resolves the billing team and\ncalls ``set_session_team_scope`` — required for per-team Datadog targeting\nrules to take effect on this evaluation.\n\nReturns:\n    ``FeatureFlagsResponse`` with each flag's resolved boolean value.","operationId":"get_feature_flags_feature_flags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagsResponse"}}}}}}},"/register-web":{"post":{"tags":["users"],"summary":"Register User","description":"Register the authenticated user's Google OAuth refresh token.\n\nOnly browser-session (JWT) callers are accepted. A valid hCaptcha token\nis required in non-local environments to prevent automated registration.\n\nThe user identity (email, full name) is sourced from the immutable\nSupabase auth identity inside :func:`register_user_core`. The request\nbody intentionally only carries the OAuth refresh token plus optional\nprofile links — any email/full_name fields a client sends are ignored\nby the Pydantic schema (ENG-1214).\n\nArgs:\n    http_request: The incoming FastAPI request.\n    request: Registration request with the OAuth refresh token.\n    auth: Authenticated user context (JWT-validated).\n\nReturns:\n    UserRegistrationResponse with success status and connection info.","operationId":"register_user_register_web_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegistrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegistrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["users"],"summary":"Get User Profile","description":"Return the authenticated user's public profile fields.\n\nArgs:\n    auth: Authenticated user context.\n\nReturns:\n    UserProfileResponse with onboarded status and intent.\n\nRaises:\n    HTTPException: 404 if user row not found, 500 on DB failure.","operationId":"get_user_profile_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}}}},"patch":{"tags":["users"],"summary":"Update User Profile","description":"Update the authenticated user's profile fields.\n\nUses service-role client to bypass RLS on the users table.\n\nArgs:\n    request: Fields to update (onboarded, intent).\n    auth: Authenticated user context.\n\nReturns:\n    UpdateUserProfileResponse with success status.\n\nRaises:\n    HTTPException: 400 if no fields provided, 500 on DB failure.","operationId":"update_user_profile_users_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/active-team":{"post":{"tags":["users"],"summary":"Set Active Team Endpoint","description":"Switch the authenticated user's active team.\n\nDelegates the locked membership write and billing-cache invalidation\nto :func:`set_active_team`, then reads the activated team back through\n:func:`get_team_response_for_user`. Both a revoked membership and a\nconcurrent teardown surface as a single 409 so the frontend has one\nretry path. Emits a ``team.activated`` audit event after the switch\ncommits.\n\nArgs:\n    request: ``{team_id: uuid}`` — target team to activate.\n    auth: Authenticated user context.\n\nReturns:\n    ``TeamResponse`` for the newly active team.\n\nRaises:\n    HTTPException: 409 if the user is not a current member of the\n        target team (or the membership is revoked between the\n        activation and the readback).","operationId":"set_active_team_endpoint_users_me_active_team_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetActiveTeamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/delete_user_account":{"post":{"tags":["users"],"summary":"Delete User Account","description":"Delete user account and all associated data (HTTP wrapper).\n\nAccepts optional cancellation feedback and ownership transfers.\nWhen ``ownership_transfers`` is provided the backend applies them\nserver-side using the admin client before proceeding with deletion,\navoiding RLS permission issues.\n\nArgs:\n    request: Optional feedback + ownership transfers.\n    auth: Authenticated user context.\n\nReturns:\n    DeleteUserResponse with status and message.","operationId":"delete_user_account_delete_user_account_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user-reports":{"post":{"tags":["user-reports"],"summary":"Create User Report","description":"Persist a browser-submitted user report via the backend.\n\nArgs:\n    request: User report payload from the frontend.\n    auth: Authenticated user context.\n    service: User report service.\n\nReturns:\n    The created report identifier.","operationId":"create_user_report_user_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserReportCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserReportCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user-reports/attachments":{"post":{"tags":["user-reports"],"summary":"Upload User Report Attachments","description":"Upload report attachments through the backend.\n\nArgs:\n    report_id: Report UUID used to group attachments.\n    files: Uploaded browser files.\n    auth: Authenticated user context.\n    service: User report service.\n\nReturns:\n    Uploaded attachment URLs.\n\nRaises:\n    HTTPException: 403 if called via API key (storage not available).\n    HTTPException: 500 if authenticated client is missing.","operationId":"upload_user_report_attachments_user_reports_attachments_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_user_report_attachments_user_reports_attachments_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserReportAttachmentUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/huggingface/oauth-state":{"post":{"tags":["huggingface"],"summary":"Create Huggingface Oauth State","description":"Create a HuggingFace OAuth state token via the backend.\n\nArgs:\n    request: Redirect URL payload.\n    auth: Authenticated user context.\n    service: HuggingFace service.\n\nReturns:\n    Generated state token for the frontend OAuth redirect.","operationId":"create_huggingface_oauth_state_huggingface_oauth_state_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFaceOAuthStateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFaceOAuthStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/huggingface/disconnect":{"post":{"tags":["huggingface"],"summary":"Disconnect Huggingface","description":"Disconnect the current user's HuggingFace connection.\n\nArgs:\n    auth: Authenticated user context.\n    service: HuggingFace service.\n\nReturns:\n    Whether the connection was disconnected.","operationId":"disconnect_huggingface_huggingface_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFaceDisconnectResponse"}}}}}}},"/auth/check-domain-limit":{"post":{"tags":["domain-limit"],"summary":"Check Domain Limit","description":"Check whether a domain is allowed to sign up.\n\nChecks in order:\n1. domain_exclusions — if matched, return banned\n2. domain_inclusions — if matched, return allowed (skip count)\n3. Count existing users — enforce SIGNUP_DOMAIN_LIMIT","operationId":"check_domain_limit_auth_check_domain_limit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainLimitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainLimitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/check-email-canonical":{"post":{"tags":["domain-limit"],"summary":"Check Email Canonical","description":"Check whether a Gmail address is a dot-trick duplicate of an existing account.\n\nOnly meaningful for ``@gmail.com`` / ``@googlemail.com`` addresses.\nAlways returns ``duplicate: false`` for all other domains.\nThis intentionally trades limited account-enumeration exposure for a clear\nsignup error; the unauthenticated route is IP-rate-limited.","operationId":"check_email_canonical_auth_check_email_canonical_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCanonicalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCanonicalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/report-blocked-domain":{"post":{"tags":["domain-limit"],"summary":"Report Blocked Domain","description":"Send a Discord notification when a user reports their domain was blocked incorrectly.","operationId":"report_blocked_domain_auth_report_blocked_domain_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainReportRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/create-api-key":{"post":{"tags":["api-keys"],"summary":"Create Api Key","description":"Create a new API key for the authenticated user.\n\nOnly JWT-authenticated (browser session) requests are permitted — API key\ncreation via an existing API key is blocked to prevent credential chaining.\n\nArgs:\n    request: The incoming FastAPI request (used by SlowAPI rate limiter).\n    body: The API key creation request payload.\n    auth: The authenticated user context.\n\nReturns:\n    CreateAPIKeyResponse with the secret key (shown only once).\n\nRaises:\n    HTTPException: 403 if called via API key, 409 if per-user key cap is\n        reached, 500 for unexpected failures.","operationId":"create_api_key_create_api_key_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/delete-api-key":{"delete":{"tags":["api-keys"],"summary":"Delete Api Key","description":"Delete an API key belonging to the authenticated user.","operationId":"delete_api_key_delete_api_key_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAPIKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/list-api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","description":"List all API keys for the authenticated user with usage statistics.\n\nDoes not return the actual key values.","operationId":"list_api_keys_list_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAPIKeysResponse"}}}}}}},"/billing/plans":{"get":{"tags":["billing"],"summary":"Get Plans","description":"Public endpoint returning plan credit limits from the database.\n\nNo authentication required — used by the frontend to display\npricing information dynamically without hardcoding dollar amounts.","operationId":"get_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/setup-payment-method":{"post":{"tags":["billing"],"summary":"Setup Payment Method","description":"Attach a payment method to the user's Stripe customer.\n\nThis endpoint:\n1. Creates a Stripe customer if one doesn't exist\n2. Attaches the payment method to the customer\n3. Sets it as the default payment method\n4. Checks card fingerprint for abuse (same card on too many teams)\n5. Stores the fingerprint and marks team as card-verified\n\nRate-limited to 5 attempts per user per hour. Each attempt captures a\n$1 PaymentIntent (real settled charge) for Stripe Radar fraud scoring,\nso unbounded retries let a single bot account incinerate Pioneer's\nStripe fee budget and Radar reputation. The cap leaves plenty of\nheadroom for legitimate users to retry on declined cards or SCA hiccups\nwhile denying bot farms unlimited attempts on the same compromised account.\n\nArgs:\n    request: FastAPI request (required by SlowAPI rate limiter).\n    body: Payment method ID from Stripe.js.\n    auth: Authenticated user context.\n\nReturns:\n    Success status and customer ID.","operationId":"setup_payment_method_billing_setup_payment_method_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupPaymentMethodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupPaymentMethodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/billing-status":{"get":{"tags":["billing"],"summary":"Get Billing Status","description":"Get billing status for the authenticated user.\n\nReturns:\n    - Total token usage\n    - Free tier remaining tokens\n    - Whether user has exceeded free tier\n    - Whether user has a payment method on file\n    - Stripe customer ID\n    - List of payment methods","operationId":"get_billing_status_billing_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatusResponse"}}}}}}},"/billing/usage-history":{"post":{"tags":["billing"],"summary":"Get Usage History","description":"Get usage history for the authenticated user.\n\nArgs:\n    request: Optional start_date and end_date filters\n    auth: Authenticated user context\n\nReturns:\n    Usage summary with detailed request history","operationId":"get_usage_history_billing_usage_history_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageHistoryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/remove-payment-method":{"delete":{"tags":["billing"],"summary":"Remove Payment Method","description":"Cancel the user's active subscription and remove the stored payment method.\n\nThis endpoint is retained for frontend compatibility, but its behavior is\nsubscription-centric:\n1. Cancels the user's active Stripe subscription immediately\n2. Downgrades the user to the Hobby plan in Supabase\n3. Removes the stored card from the Stripe customer\n\nArgs:\n    request: Active subscription payment method ID shown in the UI\n    auth: Authenticated user context\n\nReturns:\n    Success status with cancellation message","operationId":"remove_payment_method_billing_remove_payment_method_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemovePaymentMethodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/downgrade-to-free":{"post":{"tags":["billing"],"summary":"Downgrade To Free","description":"Downgrade the user from a paid plan to the free (hobby) tier.\n\nCancels all active Stripe subscriptions, removes payment methods,\nupdates the user's plan to hobby, sends a confirmation email, and\ntracks the cancellation feedback in Amplitude.\n\nArgs:\n    feedback: Optional cancellation feedback (reason + free text).\n    auth: Authenticated user context.\n\nReturns:\n    Success status with message.","operationId":"downgrade_to_free_billing_downgrade_to_free_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancellationFeedbackRequest","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/upgrade-account":{"post":{"tags":["billing"],"summary":"Upgrade Account","description":"Upgrade user's account to Pro or Enterprise plan.\n\nThis endpoint creates a Stripe Checkout session for the user to complete payment.\nAfter successful payment, the webhook will update the user's plan and reset their token usage.\n\nArgs:\n    request: Plan selection and redirect URLs\n    auth: Authenticated user context\n\nReturns:\n    Checkout URL to redirect user to","operationId":"upgrade_account_billing_upgrade_account_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeAccountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/plan-info":{"get":{"tags":["billing"],"summary":"Get Plan Info","description":"Get detailed plan information for the authenticated user.\n\nReturns:\n    Plan details including limits and current usage","operationId":"get_plan_info_billing_plan_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanInfoResponse"}}}}}}},"/billing/public-checkout":{"post":{"tags":["billing"],"summary":"Public Checkout","description":"Create a Stripe Checkout session without requiring authentication.\n\nDesigned for shareable checkout links (/checkout/pro, /checkout/research)\nwhere the user pays before creating a Pioneer account.\n\nRate-limited to 10 requests per IP per minute since the endpoint is\nunauthenticated and each call creates a Stripe Checkout Session.\nCaptcha verification required in non-local environments.\n\nArgs:\n    request: FastAPI request (required by SlowAPI rate limiter).\n    body: Plan, redirect URLs, and optional email.\n\nReturns:\n    Stripe-hosted checkout URL.","operationId":"public_checkout_billing_public_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout-session-status":{"get":{"tags":["billing"],"summary":"Get Checkout Session Status","description":"Verify a Stripe checkout session so the success page can gate its UI.\n\nUnauthenticated — any visitor with a session_id can call this, but\nonly valid Stripe session IDs will yield ``paid=True``.\n\nArgs:\n    request: FastAPI request (required by SlowAPI rate limiter).\n    session_id: Stripe checkout session ID (cs_...) from the success redirect.\n\nReturns:\n    Minimal verified status (no PII exposed).","operationId":"get_checkout_session_status_billing_checkout_session_status_get","parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Stripe checkout session ID from the success URL","title":"Session Id"},"description":"Stripe checkout session ID from the success URL"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries","description":"Aggregated credits from ``requests`` for the settings usage chart.","operationId":"get_billing_usage_timeseries_billing_usage_timeseries_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries-by-model":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries By Model","description":"Per-model request counts for stacked bar charts.","operationId":"get_billing_usage_timeseries_by_model_billing_usage_timeseries_by_model_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelUsageTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries-latency":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries Latency","description":"Average response latency bucketed by time interval.","operationId":"get_billing_usage_timeseries_latency_billing_usage_timeseries_latency_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatencyTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries-latency-by-model":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries Latency By Model","description":"Per-model average latency bucketed by time interval.","operationId":"get_billing_usage_timeseries_latency_by_model_billing_usage_timeseries_latency_by_model_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelLatencyTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries-tokens":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries Tokens","description":"Token volume (input + output) bucketed by time interval.","operationId":"get_billing_usage_timeseries_tokens_billing_usage_timeseries_tokens_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenVolumeTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/requests":{"get":{"tags":["billing"],"summary":"Get Billing Usage Requests","description":"Paginated request rows for the settings usage table.","operationId":"get_billing_usage_requests_billing_usage_requests_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page","default":1,"title":"Page"},"description":"1-based page"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size (max 100)","default":25,"title":"Page Size"},"description":"Page size (max 100)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter: created_at >= (ISO); ignored when full_history=true","title":"Start Date"},"description":"Filter: created_at >= (ISO); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter: created_at <= (ISO); with full_history, caps the window","title":"End Date"},"description":"Filter: created_at <= (ISO); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, from first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, from first request through end (or now); ignores start_date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRequestsPageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/timeseries-routed-savings":{"get":{"tags":["billing"],"summary":"Get Billing Usage Timeseries Routed Savings","description":"Router savings bucketed by time interval for the home page chart.\n\nWhen routing is live for the team the points are realized savings stamped on\nrouted inferences. When it is not, the points are an *estimate* of what the\nrouter could have saved, derived from the user's real billed spend; the\n``router_on`` flag on the response tells the client which regime applies so\nit can label/colour the line accordingly.","operationId":"get_billing_usage_timeseries_routed_savings_billing_usage_timeseries_routed_savings_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"},{"name":"interval_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":1,"description":"Bucket width in minutes (default 1440 = daily)","default":1440,"title":"Interval Minutes"},"description":"Bucket width in minutes (default 1440 = daily)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutedSavingsTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage/routed-savings":{"get":{"tags":["billing"],"summary":"Get Billing Routed Savings","description":"Routed-savings rollup per router project plus an overall total.","operationId":"get_billing_routed_savings_billing_usage_routed_savings_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true","title":"Start Date"},"description":"Range start (ISO date or datetime, UTC); ignored when full_history=true"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window","title":"End Date"},"description":"Range end (ISO date or datetime, UTC); with full_history, caps the window"},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"If true, span from the user's first request through end (or now); ignores start_date","default":false,"title":"Full History"},"description":"If true, span from the user's first request through end (or now); ignores start_date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutedSavingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team-billing-status/{team_id}":{"get":{"tags":["billing"],"summary":"Get Team Billing Status","description":"Get billing status for a team (limited info for team members).\n\nThis endpoint allows team members to see that the team owner has billing\nconfigured, without exposing sensitive billing details.\n\nArgs:\n    team_id: Team UUID\n    auth: Authenticated user context\n\nReturns:\n    - Team name\n    - Owner name\n    - Payment plan (hobby/pro/enterprise)\n    - Whether owner has a payment method configured","operationId":"get_team_billing_status_billing_team_billing_status__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamBillingStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/full-status":{"get":{"tags":["billing"],"summary":"Get Team Full Billing Status","description":"Get full billing status for a team (for billing/admin/owner roles).\n\nThis endpoint returns comprehensive billing information including\npayment methods, usage, and credit limits.\n\nRequires: MANAGE_BILLING permission (owner, admin, or billing role)\n\nArgs:\n    team_id: Team UUID\n    auth: Authenticated user context\n\nReturns:\n    Full team billing status including payment methods and usage","operationId":"get_team_full_billing_status_billing_team__team_id__full_status_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamBillingFullStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/setup-payment-method":{"post":{"tags":["billing"],"summary":"Setup Team Payment Method","description":"Attach a payment method to a team's Stripe customer.\n\nRequires: MANAGE_BILLING permission (owner, admin, or billing role)\n\nThis endpoint:\n1. Creates a Stripe customer for the team if one doesn't exist\n2. Attaches the payment method to the team's customer\n3. Sets it as the default payment method\n\nRate-limited to 5 attempts per user per hour. Each attempt captures a\n$1 PaymentIntent (real settled charge) for Stripe Radar fraud scoring,\nso unbounded retries from a single owner/admin let a bot incinerate the\nStripe fee budget and burn Radar reputation. The cap leaves room for\nlegitimate retries on declined cards or SCA hiccups while denying bots\nunlimited attempts on the same compromised owner account.\n\nArgs:\n    request: FastAPI request (required by SlowAPI rate limiter).\n    team_id: Team UUID.\n    body: Payment method ID from Stripe.js.\n    auth: Authenticated user context.\n\nReturns:\n    Success status and customer ID.","operationId":"setup_team_payment_method_billing_team__team_id__setup_payment_method_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupTeamPaymentMethodRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupPaymentMethodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/remove-payment-method":{"delete":{"tags":["billing"],"summary":"Remove Team Payment Method","description":"Remove the team's payment method and downgrade to Hobby plan.\n\nRequires: MANAGE_BILLING permission (owner, admin, or billing role)\n\nThis endpoint:\n1. Cancels any active Stripe subscriptions for the team\n2. Downgrades the team to the Hobby plan\n3. Removes the stored card from the Stripe customer\n\nArgs:\n    team_id: Team UUID\n    request: Payment method ID to remove\n    auth: Authenticated user context\n\nReturns:\n    Success status with message","operationId":"remove_team_payment_method_billing_team__team_id__remove_payment_method_delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveTeamPaymentMethodRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/reactivate-subscription":{"post":{"tags":["billing"],"summary":"Reactivate Subscription","description":"Undo a pending subscription cancellation.\n\nIf the team's subscription is scheduled to cancel at period end,\nthis removes the cancellation so the subscription renews normally.\nPrevents double-charging when a user cancels then changes their mind.","operationId":"reactivate_subscription_billing_team__team_id__reactivate_subscription_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/usage":{"get":{"tags":["billing"],"summary":"Get Team Member Usage","description":"Get usage breakdown by team member.\n\nRequires: MANAGE_BILLING permission (owner, admin, or billing role)\n\nReturns per-member usage including:\n- User email and name\n- Total credits used\n- Request count\n\nArgs:\n    team_id: Team UUID\n    auth: Authenticated user context\n\nReturns:\n    Team usage breakdown by member","operationId":"get_team_member_usage_billing_team__team_id__usage_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/billing-portal":{"post":{"tags":["billing"],"summary":"Create Billing Portal Session","description":"Create a Stripe Billing Portal session for a team.\n\nAllows users with billing permissions to manage their subscription,\npayment methods, and invoices through Stripe's hosted portal.\n\nArgs:\n    team_id: Team UUID.\n    return_url: URL to redirect the user back to after the portal.\n    auth: Authenticated user context.\n\nReturns:\n    BillingPortalResponse with the portal URL.\n\nRaises:\n    HTTPException: 403 if not a member or lacks permission,\n        400 if return_url is untrusted or no Stripe customer exists.","operationId":"create_billing_portal_session_billing_team__team_id__billing_portal_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"return_url","in":"query","required":true,"schema":{"type":"string","description":"URL to redirect to after the portal session","title":"Return Url"},"description":"URL to redirect to after the portal session"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/seat-preview":{"get":{"tags":["billing"],"summary":"Get Seat Change Preview","description":"Preview cost impact of adding or removing seats without applying changes.\n\nRequires MANAGE_BILLING permission.\n\nArgs:\n    team_id: Team UUID.\n    action: Either 'add' or 'remove'.\n    count: Number of seats to change.\n    auth: Authenticated user context.\n\nReturns:\n    SeatChangePreview with current/new seat counts and pricing.","operationId":"get_seat_change_preview_billing_team__team_id__seat_preview_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"action","in":"query","required":true,"schema":{"type":"string","description":"'add' or 'remove'","title":"Action"},"description":"'add' or 'remove'"},{"name":"count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of seats to add/remove","default":1,"title":"Count"},"description":"Number of seats to add/remove"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatChangePreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/upgrade-plan":{"post":{"tags":["billing"],"summary":"Upgrade Team Plan","description":"Upgrade a team's plan directly without Stripe Checkout.\n\nRequires the team to already have a payment method on file. Creates a\nStripe subscription for the target plan price. Optionally applies a\npromotion code.","operationId":"upgrade_team_plan_billing_team__team_id__upgrade_plan_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeTeamPlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeTeamPlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/overage-settings":{"get":{"tags":["billing"],"summary":"Get team overage settings","description":"Return current overage billing configuration for the team.","operationId":"get_overage_settings_billing_team__team_id__overage_settings_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["billing"],"summary":"Update team overage settings","description":"Update overage billing configuration. Only team owners/admins can modify.","operationId":"update_overage_settings_billing_team__team_id__overage_settings_patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOverageSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/charge-history":{"get":{"tags":["billing"],"summary":"List charge history for a team","description":"Return recent Stripe charges and invoices for the team.","operationId":"get_charge_history_billing_team__team_id__charge_history_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/purchase-credits":{"post":{"tags":["billing"],"summary":"Purchase credits directly","description":"Charge the team's payment method and add credits to their paid balance.","operationId":"purchase_credits_billing_team__team_id__purchase_credits_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseCreditsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseCreditsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/team/{team_id}/check-topup":{"post":{"tags":["billing"],"summary":"Force a threshold top-up check","description":"Manually trigger the overage threshold check for a team.\n\nIf the team's remaining balance is below their charge threshold,\nthis will fire the same top-up charge that normally triggers on inference.","operationId":"check_topup_billing_team__team_id__check_topup_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/stripe-webhook":{"post":{"tags":["billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n\nThis endpoint is called by Stripe to notify us of billing events.\nIt verifies the webhook signature and processes relevant events.\n\nEvents handled:\n- checkout.session.completed: Handle successful plan upgrade\n- invoice.paid: Log successful payment\n- invoice.payment_failed: Invalidate cached API-key billing state\n- customer.subscription.deleted: Reconcile cancellation + silent API-key block\n- customer.subscription.updated: Reconcile terminal-status transitions\n- payment_method.attached: Heal card verification state\n- payment_method.detached: Reset card_verified for the affected teams\n- customer.deleted: Null out ``teams.stripe_customer_id``\n\nNote: This endpoint is unprotected (no auth) but verifies Stripe signature.","operationId":"stripe_webhook_billing_stripe_webhook_post","parameters":[{"name":"stripe-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/gliner-2":{"post":{"tags":["gliner"],"summary":"Gliner2 Process","description":"Process text using GLiNER-2 base model via InferenceService.\n\n``task`` is optional — when omitted the unified schema path is used.\nLegacy task names are still accepted but deprecated.","operationId":"gliner2_process_gliner_2_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlinerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlinerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gliner-2/async":{"post":{"tags":["gliner"],"summary":"Gliner2 Async","description":"Submit large GLiNER-2 request for async processing.\n\nUse this endpoint when processing >1M tokens that would exceed\nthe 30-second timeout. Returns immediately with a job_id.\nPoll GET /gliner-2/jobs/{job_id} to retrieve results.\n\nArgs:\n    request: AsyncGlinerRequest with task, text, schema\n    http_request: FastAPI request object\n    background_tasks: FastAPI background tasks\n    auth: Authentication result\n\nReturns:\n    202 Accepted with job_id for polling","operationId":"gliner2_async_gliner_2_async_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncGlinerRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncGlinerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gliner-2/jobs/{job_id}":{"get":{"tags":["gliner"],"summary":"Gliner2 Job Status","description":"Get status and result of an async GLiNER-2 job.\n\nReturns:\n- 200 with status=\"complete\" and result when done\n- 200 with status=\"processing\" while in progress\n- 200 with status=\"error\" and error message if failed\n- 404 if job not found or belongs to different user\n\nArgs:\n    job_id: UUID of the job to check\n    auth: Authentication result\n\nReturns:\n    GlinerJobStatus with current status and result if complete","operationId":"gliner2_job_status_gliner_2_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlinerJobStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/benchmarks":{"get":{"tags":["felix"],"summary":"List Benchmarks","description":"List available benchmarks for model evaluation.\n\nReturns benchmarks organized by task type (ner, text_classification, summarization).","operationId":"list_benchmarks_felix_benchmarks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBenchmarksResponse"}}}}}}},"/felix/benchmarks/evaluate":{"post":{"tags":["felix"],"summary":"Start Benchmark Evaluation","description":"Start an asynchronous benchmark evaluation.\n\nLaunches evaluation in the background and returns immediately with\nan evaluation_id that can be used to check status.","operationId":"start_benchmark_evaluation_felix_benchmarks_evaluate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkEvaluationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkEvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/benchmarks/evaluate/{evaluation_id}":{"get":{"tags":["felix"],"summary":"Get Benchmark Evaluation","description":"Get the status and results of a benchmark evaluation.","operationId":"get_benchmark_evaluation_felix_benchmarks_evaluate__evaluation_id__get","parameters":[{"name":"evaluation_id","in":"path","required":true,"schema":{"type":"string","title":"Evaluation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkEvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/benchmarks/evaluate/{evaluation_id}/cancel":{"post":{"tags":["felix"],"summary":"Cancel Benchmark Evaluation","description":"Cancel a running benchmark evaluation.","operationId":"cancel_benchmark_evaluation_felix_benchmarks_evaluate__evaluation_id__cancel_post","parameters":[{"name":"evaluation_id","in":"path","required":true,"schema":{"type":"string","title":"Evaluation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBenchmarkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/constraints/ner":{"post":{"tags":["felix"],"summary":"Generate Ner Constraints Endpoint","description":"Generate constraints for NER tasks","operationId":"generate_ner_constraints_endpoint_felix_constraints_ner_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateNERConstraintsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateConstraintsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/constraints/classification":{"post":{"tags":["felix"],"summary":"Generate Classification Constraints Endpoint","description":"Generate constraints for classification tasks","operationId":"generate_classification_constraints_endpoint_felix_constraints_classification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateClassificationConstraintsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateConstraintsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/constraints/records":{"post":{"tags":["felix"],"summary":"Generate Records Constraints Endpoint","description":"Generate constraints for records/custom tasks","operationId":"generate_records_constraints_endpoint_felix_constraints_records_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRecordsConstraintsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateConstraintsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/constraints/expand":{"post":{"tags":["felix"],"summary":"Expand Constraint Choices Endpoint","description":"Expand choices for a constraint","operationId":"expand_constraint_choices_endpoint_felix_constraints_expand_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandConstraintChoicesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandConstraintChoicesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/data-editing/scan-pii":{"post":{"tags":["felix"],"summary":"Scan For Pii","description":"Scan dataset columns for Personally Identifiable Information (PII).\n\nUses GLiNER for entity extraction to detect names, emails, phone numbers, etc.\n\nArgs:\n    request.dataset_name: Dataset name.\n    request.version: Optional version number. Returns latest if omitted.","operationId":"scan_for_pii_felix_data_editing_scan_pii_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/data-editing/scan-phd":{"post":{"tags":["felix"],"summary":"Scan For Phd","description":"Scan dataset columns for Prompt Hack/Injection attempts (PHD).\n\nUses specialized model to detect prompt injection attempts.\n\nArgs:\n    request.dataset_name: Dataset name.\n    request.version: Optional version number. Returns latest if omitted.","operationId":"scan_for_phd_felix_data_editing_scan_phd_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/data-editing/remove-pii":{"post":{"tags":["felix"],"summary":"Remove Pii","description":"Remove or redact PII from the dataset based on scan findings.\n\nCreates a new dataset version with the redacted data.","operationId":"remove_pii_felix_data_editing_remove_pii_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingRemoveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingRemoveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/data-editing/subsample":{"post":{"tags":["felix"],"summary":"Subsample Dataset","description":"Create a subsample of the dataset using random or balanced sampling.\n\nCreates a new dataset version with the subsampled data.","operationId":"subsample_dataset_felix_data_editing_subsample_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingSubsampleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingSubsampleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/data-editing/check-labels":{"post":{"tags":["felix"],"summary":"Check Labels","description":"Use AI to verify label quality by checking if labels match the text content.\n\nArgs:\n    request: Label check request with dataset name, columns, and sample size.\n    auth: Authenticated user.\n\nReturns:\n    Label check results with per-row assessments.\n\nRaises:\n    HTTPException: 404 if dataset not found, 400 for invalid columns,\n        504 if upstream LLM provider times out.","operationId":"check_labels_felix_data_editing_check_labels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingCheckLabelsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEditingCheckLabelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/analyze":{"post":{"tags":["felix"],"summary":"Analyze Dataset","description":"Analyze a dataset for quality, distribution, and potential issues.\n\nSupports NER, Classification, and Generative task types. Available\nanalyses: distribution, duplicates, outliers, correlation, splits,\nerrors, and diversity (Vendi score + embedding visualisation).\n\nProvide data inline via ``dataset`` or reference a stored dataset\nwith ``dataset_name``.  See ``DatasetAnalysisRequest`` schema for\nthe full set of options including diversity visualisation config.","operationId":"analyze_dataset_felix_dataset_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAnalysisRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAnalysisResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/outliers/dismiss":{"post":{"tags":["felix"],"summary":"Dismiss Outlier","description":"Dismiss an outlier so it no longer appears in analysis results.\n\nAppends the content fingerprint to the ``dismissed_outliers`` JSONB\narray on the dataset row. On subsequent analysis runs the fingerprint\nis matched and the outlier is filtered out of the response.","operationId":"dismiss_outlier_felix_dataset_outliers_dismiss_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissOutlierRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissOutlierResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/analyze_llm":{"post":{"tags":["felix"],"summary":"Analyze Dataset Llm","description":"Run LLM-based dataset quality analysis.\n\nThis endpoint performs the slow (~8s) LLM-based diversity and quality\nanalysis separately from the fast statistical analysis endpoint.\n\nUse ``/felix/dataset/analyze`` for fast statistical metrics (distribution,\nduplicates, outliers, vendi score, visualization). Use this endpoint when\nyou need the LLM's reasoning about dataset quality and reducibility.\n\nProvide data inline via ``dataset`` or reference a stored dataset\nwith ``dataset_name``.","operationId":"analyze_dataset_llm_felix_dataset_analyze_llm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLLMAnalysisRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiversityLLMAnalysis"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/augment":{"post":{"tags":["felix"],"summary":"Augment Dataset","description":"Augment a dataset by removing duplicates/outliers and generating synthetic samples.\n\nThis endpoint creates a NEW dataset with the augmentations applied.\nOperations include:\n- **remove_duplicates**: Remove exact duplicate samples.\n- **remove_outliers**: Remove samples with anomalous lengths.\n- **balance**: Generate synthetic samples for underrepresented classes/entities.\n\nThe original dataset is preserved.","operationId":"augment_dataset_felix_dataset_augment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAugmentationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetAugmentationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/query":{"post":{"tags":["felix"],"summary":"Query Dataset","description":"Execute Polars code on a dataset server-side.\n\nThe code runs in a sandboxed environment with access to:\n- `df`: Polars DataFrame containing the dataset\n- `pl`: Polars module for expressions\n\nAssign the result to a `result` variable to return it.\n**Multiline code is fully supported** — use intermediate variables, comments, etc.\n\n**Security**: Only allowlisted Polars DataFrame/Expression methods are\npermitted. Control-flow (for/while/if-stmt), comprehensions, f-strings,\nstr.format, imports, eval/exec, and dunder access are all blocked.\n\n**Examples**::\n\n    result = df.head(10)\n\n    filtered = df.filter(pl.col('score') > 0.5)\n    grouped = filtered.group_by('label').agg([\n        pl.col('score').mean().alias('avg_score'),\n        pl.col('score').count().alias('count')\n    ])\n    result = grouped.sort('avg_score', descending=True)","operationId":"query_dataset_felix_dataset_query_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetQueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/embeddings":{"post":{"tags":["felix"],"summary":"Create Embeddings","description":"Generate embeddings for a single text input.\n\nThe endpoint accepts a text string and an optional embedding model name\n(defaults to openai/text-embedding-3-small) and returns the numeric vector from\nOpenRouter. Non-finite values are removed to keep the payload safe for clients.","operationId":"create_embeddings_felix_embeddings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}/evaluations":{"get":{"tags":["felix"],"summary":"Get Dataset Evaluations","description":"Get all evaluations for a dataset.\n\nArgs:\n    name: Dataset name.\n    version: Dataset version (use \"latest\" for most recent).\n\nReturns all of the user's deployed models with their evaluation results\nfor the specified dataset. Models without evaluations will have null evaluation data.","operationId":"get_dataset_evaluations_felix_datasets__name___version__evaluations_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetEvaluationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/evaluations":{"post":{"tags":["felix"],"summary":"Create Evaluation","description":"Create model evaluation job(s) for multiple models and datasets.\n\nArgs:\n    request.base_model: Primary model to evaluate (required).\n    request.comparison_models: Optional list of models to compare against.\n    request.dataset_name: Single dataset name (for backward compatibility).\n    request.dataset_names: List of dataset names (creates one evaluation per dataset).\n    request.dataset_version: Optional version (latest if omitted).\n    request.max_tokens: Optional decoder generation cap per example.\n\nThis creates evaluation records for each model x dataset combination and triggers\nasync evaluation jobs. Each job runs inference on its dataset and computes metrics.\n\nReturns:\n    EvaluationCreateResponse with list of created evaluations.","operationId":"create_evaluation_felix_evaluations_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["felix"],"summary":"List Evaluations","description":"List all evaluations for the authenticated user.\n\nReturns model and benchmark evaluations with their metrics.\nUsed by the frontend to build the evaluations matrix view.\n\nIf ``project_id`` is the sentinel ``\"default\"``, returns only\nevaluations whose ``project_id`` is null (the unallocated bucket).\nIf ``project_id`` is any other value, it must be a valid UUID and\nthe response includes evaluations for that project plus orphan\nevaluations (legacy behavior). If ``model_id`` is provided, only\nevaluations for that model are returned.","operationId":"list_evaluations_felix_evaluations_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project ID. Pass the literal value 'default' to return only orphan evaluations (project_id IS NULL). For real project UUIDs the response also includes orphans for backward compatibility.","title":"Project Id"},"description":"Filter by project ID. Pass the literal value 'default' to return only orphan evaluations (project_id IS NULL). For real project UUIDs the response also includes orphans for backward compatibility."},{"name":"model_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter evaluations by the evaluated model's ID","title":"Model Id"},"description":"Filter evaluations by the evaluated model's ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Maximum evaluations to return in this page.","default":100,"title":"Limit"},"description":"Maximum evaluations to return in this page."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor returned by the previous page.","title":"Cursor"},"description":"Opaque cursor returned by the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationListResponse"}}}},"503":{"description":"Evaluation listing dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/evaluations/upload":{"post":{"tags":["felix"],"summary":"Upload Evaluation Results","description":"Upload manually computed evaluation results so they appear in the UI.","operationId":"upload_evaluation_results_felix_evaluations_upload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadEvaluationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/baseline-models":{"get":{"tags":["felix"],"summary":"List Baseline Models","description":"List available baseline LLM models for evaluation comparison.\n\nBackend selection is owned by ``InferenceService`` — these entries are\npurely a catalog of model IDs the eval pipeline knows how to drive.","operationId":"list_baseline_models_felix_baseline_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/felix/evaluations/{evaluation_id}":{"get":{"tags":["felix"],"summary":"Get Evaluation","description":"Get the status and results of a specific evaluation.","operationId":"get_evaluation_felix_evaluations__evaluation_id__get","parameters":[{"name":"evaluation_id","in":"path","required":true,"schema":{"type":"string","title":"Evaluation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix"],"summary":"Delete Evaluation","description":"Delete an evaluation by ID.\n\nVerifies ownership via user_id before deleting.\n\nArgs:\n    evaluation_id: The evaluation ID to delete.\n    auth: Authenticated user context.\n\nReturns:\n    DeleteEvaluationResponse indicating success.\n\nRaises:\n    HTTPException: 404 if evaluation not found or not owned by user.\n    HTTPException: 500 if an unexpected error occurs.","operationId":"delete_evaluation_felix_evaluations__evaluation_id__delete","parameters":[{"name":"evaluation_id","in":"path","required":true,"schema":{"type":"string","title":"Evaluation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/evaluations/{evaluation_id}/project":{"patch":{"tags":["felix"],"summary":"Update Evaluation Project","description":"Assign or unassign an evaluation to/from a project.\n\nArgs:\n    evaluation_id: The evaluation ID.\n    request: Contains the project_id to assign (or empty string to unassign).\n    auth: Authenticated user context.\n\nReturns:\n    UpdateResourceProjectResponse indicating success.\n\nRaises:\n    HTTPException: If the evaluation is not found or the update fails.","operationId":"update_evaluation_project_felix_evaluations__evaluation_id__project_patch","parameters":[{"name":"evaluation_id","in":"path","required":true,"schema":{"type":"string","title":"Evaluation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate":{"post":{"tags":["generate"],"summary":"Create Generation Job","description":"Create an async dataset generation job.\n\nReturns immediately with a ``job_id``. Poll ``GET /generate/jobs/{job_id}``\nfor status and results.\n\nThe ``task_type`` field in the request body determines what kind of dataset\nis generated:\n- ``ner``: Named-entity recognition dataset. Requires ``labels``.\n- ``classification``: Text classification dataset. Requires ``labels``.\n- ``custom``: Free-form prompt-based dataset. Requires ``prompt``.\n- ``decoder``: Instruction-tuning (chat format) dataset.\n  Requires ``domain_description``.\n\nDispatches via SQS with idempotency deduplication; falls back to in-process\nBackgroundTasks if SQS is unavailable.\n\nArgs:\n    request: Incoming HTTP request (used by SlowAPI rate limiter).\n    generation_request: Unified generation parameters including task_type.\n    background_tasks: FastAPI background tasks for the SQS fallback path.\n    auth: Authenticated user context.\n    is_seed: Whether this is a small seed dataset for UI preview.\n    synthesis_session_id: Optional synthesis log session UUID for resume.\n\nReturns:\n    GenerateAsyncResponse with ``job_id`` for polling and initial status.\n\nRaises:\n    HTTPException: 422 if required task-specific fields are missing.","operationId":"create_generation_job_generate_post","parameters":[{"name":"is_seed","in":"query","required":false,"schema":{"type":"boolean","description":"Whether this is a seed generation","default":false,"title":"Is Seed"},"description":"Whether this is a seed generation"},{"name":"synthesis_session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Synthesis log session ID for resume support","title":"Synthesis Session Id"},"description":"Synthesis log session ID for resume support"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAsyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/jobs/{job_id}":{"get":{"tags":["generate"],"summary":"Get Generation Job Status","description":"Get the current status of an async generation job.\n\nReturns the current status and, when complete, the generated data.\n\nArgs:\n    job_id: The job/dataset UUID to query.\n    auth: Authenticated user context.\n\nReturns:\n    GenerateJobStatus with status and data when the job is 'ready'.\n\nRaises:\n    HTTPException: 400 if job_id is not a valid UUID.\n    HTTPException: 404 if the job is not found or not owned by this user.","operationId":"get_generation_job_status_generate_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateJobStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/ner/infer-labels":{"post":{"tags":["generate"],"summary":"Infer Ner Labels","description":"Infer NER entity types from a domain description.","operationId":"infer_ner_labels_generate_ner_infer_labels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferNERLabelsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferLabelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/classification/infer-labels":{"post":{"tags":["generate"],"summary":"Infer Classification Labels","description":"Infer classification labels from a domain description.","operationId":"infer_classification_labels_generate_classification_infer_labels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferClassificationLabelsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferLabelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/fields/infer-fields":{"post":{"tags":["generate"],"summary":"Infer Fields","description":"Infer input and output fields from a domain description.","operationId":"infer_fields_generate_fields_infer_fields_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferFieldsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferFieldsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/improve-prompt":{"post":{"tags":["generate"],"summary":"Improve Prompt","description":"Improve a dataset generation prompt with AI-generated expansions.","operationId":"improve_prompt_generate_improve_prompt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImprovePromptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImprovePromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/infer-advanced":{"post":{"tags":["generate"],"summary":"Infer Advanced Options","description":"Infer constraints and multiplicator from a generation prompt.","operationId":"infer_advanced_options_generate_infer_advanced_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferAdvancedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferAdvancedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/ner/label-existing":{"post":{"tags":["generate"],"summary":"Label Existing Ner","description":"Label existing texts for NER entity extraction.\n\nApplies the provided label set to a corpus of raw texts using Felix.\n\nArgs:\n    request: NER labeling request with texts and label definitions.\n    auth: Authenticated user context.\n\nReturns:\n    GenerateResponse with labeled samples and optional dataset info.\n\nRaises:\n    HTTPException: 400 if no valid inputs or dataset validation fails.\n    HTTPException: 500 on labeling failure.","operationId":"label_existing_ner_generate_ner_label_existing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelExistingNERRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/classification/label-existing":{"post":{"tags":["generate"],"summary":"Label Existing Classification","description":"Label existing texts for classification tasks.\n\nArgs:\n    request: Classification labeling request with texts and labels.\n    auth: Authenticated user context.\n\nReturns:\n    GenerateResponse with classified samples and optional dataset info.\n\nRaises:\n    HTTPException: 400 if no valid inputs or dataset validation fails.\n    HTTPException: 500 on labeling failure.","operationId":"label_existing_classification_generate_classification_label_existing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelExistingClassificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate/fields/label-existing":{"post":{"tags":["generate"],"summary":"Label Existing Fields","description":"Label existing data dictionaries with custom input/output field definitions.\n\nArgs:\n    request: Fields labeling request with input dicts and field schemas.\n    auth: Authenticated user context.\n\nReturns:\n    GenerateResponse with labeled samples and optional dataset info.\n\nRaises:\n    HTTPException: 400 on invalid field configuration, missing inputs, or dataset validation failure.\n    HTTPException: 500 on labeling failure.","operationId":"label_existing_fields_generate_fields_label_existing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelExistingFieldsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/logs/{session_id}":{"get":{"tags":["felix"],"summary":"Stream Logs","description":"Stream logs for a generation session via Server-Sent Events","operationId":"stream_logs_felix_logs__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/presets":{"get":{"tags":["felix"],"summary":"List Presets","description":"List all available presets for authenticated callers.","operationId":"list_presets_felix_presets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PresetMetadata"},"type":"array","title":"Response List Presets Felix Presets Get"}}}}}}},"/felix/presets/{preset_id}":{"get":{"tags":["felix"],"summary":"Get Preset","description":"Get a preset configuration for authenticated callers.","operationId":"get_preset_felix_presets__preset_id__get","parameters":[{"name":"preset_id","in":"path","required":true,"schema":{"type":"string","title":"Preset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs":{"post":{"tags":["felix"],"summary":"Create Training Job","description":"Create a new training job.\n\nThe provider is resolved from the registry based on\n``(base_model, training_type)``.\n\nArgs:\n    request: Incoming FastAPI request (required by SlowAPI key function).\n    training_request: Training configuration with dataset references and base_model.\n    background_tasks: FastAPI BackgroundTasks, injected for the Fireworks\n        SQS fallback path (used in local dev when SQS is unavailable).\n    auth: Authenticated user context.","operationId":"create_training_job_felix_training_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["felix"],"summary":"List Training Jobs","description":"List training jobs for the authenticated user.\n\nSupports pagination via ``limit`` and ``offset`` query parameters.\nOptionally filter by status (requested, running, complete, deployed, errored).","operationId":"list_training_jobs_felix_training_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}":{"get":{"tags":["felix"],"summary":"Get Training Job","description":"Get a specific training job by ID.","operationId":"get_training_job_felix_training_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix"],"summary":"Delete Training Job","description":"Delete a training job and associated checkpoints.","operationId":"delete_training_job_felix_training_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTrainingJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["felix"],"summary":"Update Training Job","description":"Patch a training job. Currently exposes only ``project_id``.\n\nDelegates to :func:`services.projects.movement.assign_resource_to_project`\nwhich owns the visibility check, target-project gating, and the\nservice-role ``UPDATE``. Send ``project_id: null`` to unassign the job\nfrom its project.\n\nMovement is **label-only**: only ``training_jobs.project_id`` changes.\nDependent rows that carry their own ``project_id`` (``deployments``,\n``inferences``, ``model_evaluations``) are intentionally not cascaded.\nCallers needing aggregate-model movement must update dependents\nexplicitly.","operationId":"update_training_job_felix_training_jobs__job_id__patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/logs":{"get":{"tags":["felix"],"summary":"Get Training Job Logs","description":"Get training output logs (stdout/stderr) for a specific job.","operationId":"get_training_job_logs_felix_training_jobs__job_id__logs_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingLogsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/sync":{"post":{"tags":["felix"],"summary":"Sync Training Job Status","description":"Sync training job status from the provider to the database.","operationId":"sync_training_job_status_felix_training_jobs__job_id__sync_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/stop":{"post":{"tags":["felix"],"summary":"Stop Training Job","description":"Stop a running training job.","operationId":"stop_training_job_felix_training_jobs__job_id__stop_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/terminate":{"post":{"tags":["felix"],"summary":"Terminate Training Job","description":"Terminate a training job and delete all artifacts.\n\nStops the provider job if running, deletes all checkpoints, and marks\nthe job as terminated. This operation is irreversible.","operationId":"terminate_training_job_felix_training_jobs__job_id__terminate_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerminateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/checkpoints":{"get":{"tags":["felix"],"summary":"List Training Job Checkpoints","description":"List all checkpoints for a training job.","operationId":"list_training_job_checkpoints_felix_training_jobs__job_id__checkpoints_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckpointListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/checkpoints/{checkpoint_id}/deploy":{"post":{"tags":["felix"],"summary":"Deploy Checkpoint To Mme","description":"Deploy a specific checkpoint to the Multi-Model Endpoint.","operationId":"deploy_checkpoint_to_mme_felix_training_jobs__job_id__checkpoints__checkpoint_id__deploy_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"checkpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Checkpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployCheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/trained-models":{"get":{"tags":["felix"],"summary":"List Trained Models","description":"List all completed/trained models for the authenticated user.\n\nArgs:\n    project_id: Optional project filter. When supplied, only models\n        assigned to that project are returned (still subject to the\n        caller's visibility scope). Used by the agent to keep model\n        discovery scoped to the user-selected project.","operationId":"list_trained_models_felix_trained_models_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/download":{"get":{"tags":["felix"],"summary":"Get download URL for trained model","description":"Generate a presigned S3 URL to download a trained model.","operationId":"download_trained_model_felix_training_jobs__job_id__download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/model-name":{"patch":{"tags":["felix"],"summary":"Update Training Job Model Name","description":"Update the model_name for a training job.\n\nThin wrapper: visibility scoping, validation, the UPDATE, and the\nactivity-event side effect all live in\n:meth:`TrainingJobService.update_model_name`. The router only owns\nHTTP concerns (status codes, request/response shaping) per\n``brain/CLAUDE.md``.","operationId":"update_training_job_model_name_felix_training_jobs__job_id__model_name_patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelNameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelNameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/push-to-hub":{"post":{"tags":["felix"],"summary":"Push Training Job To Huggingface","description":"Push a completed training job's model to HuggingFace Hub.","operationId":"push_training_job_to_huggingface_felix_training_jobs__job_id__push_to_hub_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFacePushModelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushModelToHubResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training-pipelines":{"get":{"tags":["training-pipelines"],"summary":"List Training Pipelines","description":"List multi-stage training pipelines for the authenticated user.","operationId":"list_training_pipelines_training_pipelines_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["training-pipelines"],"summary":"Create Training Pipeline","description":"Create a pipeline root and dispatch its first stage.","operationId":"create_training_pipeline_training_pipelines_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training-pipelines/estimate":{"post":{"tags":["training-pipelines"],"summary":"Estimate Training Pipeline","description":"Return a read-only estimate for a pipeline recipe.","operationId":"estimate_training_pipeline_training_pipelines_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineEstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training-pipelines/{pipeline_id}":{"get":{"tags":["training-pipelines"],"summary":"Get Training Pipeline","description":"Return one pipeline root with stage progress and lineage.","operationId":"get_training_pipeline_training_pipelines__pipeline_id__get","parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training-pipelines/{pipeline_id}/deployments":{"get":{"tags":["training-pipelines"],"summary":"Get Training Pipeline Deployments","description":"Return deployment history derived from pipeline stage rows.","operationId":"get_training_pipeline_deployments_training_pipelines__pipeline_id__deployments_get","parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPipelineDeploymentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/activity":{"get":{"tags":["felix"],"summary":"List Activity","description":"List activity events for the authenticated user.\n\nUses the activity_events table to provide a unified timeline of user actions.\nSupports pagination via limit/offset.\n\nArgs:\n    limit: Maximum number of activity events to return per page.\n    offset: Number of events to skip for pagination.\n    auth: Authentication result containing user context.\n\nReturns:\n    ActivityLogResponse containing activity events in reverse-chronological order.\n\nRaises:\n    HTTPException: If the activity log retrieval fails.","operationId":"list_activity_felix_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/dataset/grow":{"post":{"tags":["felix"],"summary":"Grow Dataset","description":"Grow an existing dataset by generating new synthetic examples.\n\nTakes an existing classification or NER dataset and generates additional\nexamples to reach the target size. Supports class balancing to ensure\nequal representation of each class.\n\nArgs:\n    request: Growth request with dataset ID, target size, and options.\n    auth: Authentication result with user ID and client.\n\nReturns:\n    GrowDatasetResponse with new dataset info and generation statistics.\n\nRaises:\n    HTTPException: If dataset not found, invalid type, or generation fails.","operationId":"grow_dataset_felix_dataset_grow_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowDatasetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowDatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/synthesis-log":{"post":{"tags":["felix","synthesis-log"],"summary":"Create Log Entry","description":"Create a single synthesis log entry.\n\nArgs:\n    request: Log entry data.\n    auth: Authentication result.\n\nReturns:\n    The created SynthesisLogEntry.\n\nRaises:\n    HTTPException: If the entry could not be created.","operationId":"create_log_entry_felix_synthesis_log_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesisLogCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesisLogEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/synthesis-log/session/{session_id}":{"get":{"tags":["felix","synthesis-log"],"summary":"Get Session","description":"Get all log entries for a synthesis session.\n\nArgs:\n    session_id: UUID of the synthesis session.\n    auth: Authentication result.\n\nReturns:\n    All entries for the session in chronological order.\n\nRaises:\n    HTTPException: If the query fails.","operationId":"get_session_felix_synthesis_log_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesisLogSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/synthesis-log/dataset/{dataset_id}":{"get":{"tags":["felix","synthesis-log"],"summary":"Get Dataset History","description":"Get all synthesis log entries linked to a dataset.\n\nArgs:\n    dataset_id: UUID of the dataset.\n    auth: Authentication result.\n\nReturns:\n    All synthesis log entries for the dataset in chronological order.\n\nRaises:\n    HTTPException: If the query fails.","operationId":"get_dataset_history_felix_synthesis_log_dataset__dataset_id__get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesisLogDatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/synthesis-log/session/{session_id}/link":{"post":{"tags":["felix","synthesis-log"],"summary":"Link Session To Dataset","description":"Link all entries in a synthesis session to a dataset.\n\nCalled after a synthesized dataset is created so the history is\naccessible from the dataset detail page.\n\nArgs:\n    session_id: UUID of the synthesis session.\n    request: Contains the dataset_id to link.\n    auth: Authentication result.\n\nReturns:\n    Success indicator.\n\nRaises:\n    HTTPException: If the link operation fails.","operationId":"link_session_to_dataset_felix_synthesis_log_session__session_id__link_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesisLogLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Link Session To Dataset Felix Synthesis Log Session  Session Id  Link Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/deployments":{"post":{"tags":["deployments"],"summary":"Deploy a model to a project","description":"Activate a model as the project's active model and record the swap.\n\nExactly one of ``training_job_id`` (a fine-tuned checkpoint) or\n``base_model`` (a stock HuggingFace base model) must be supplied in the\nrequest body; this is enforced by the ``DeploymentCreate`` schema.\n\nArgs:\n    project_id: ID of the project to update.\n    request: Deployment target (training job or base model) and optional\n        reason.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentResponse with the new history record.\n\nRaises:\n    400: If the supplied base model is not in the catalog.\n    403: If the user does not have access to the project.\n    404: If the project or training job is not found.","operationId":"deploy_model_projects__project_id__deployments_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["deployments"],"summary":"List deployment history for a project","description":"Return deployment history for a project, newest first.\n\nArgs:\n    project_id: ID of the project to query.\n    limit: Maximum number of records to return (1-100, default 50).\n    auth: Authenticated user.\n\nReturns:\n    DeploymentHistoryResponse with ordered deployment records.\n\nRaises:\n    403: If the user does not have access to the project.","operationId":"list_deployments_projects__project_id__deployments_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/deployments/{deployment_id}":{"get":{"tags":["deployments"],"summary":"Get a single deployment record","description":"Fetch a specific deployment history record.\n\nArgs:\n    project_id: Project the deployment belongs to.\n    deployment_id: Deployment record ID.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentResponse for the record.\n\nRaises:\n    403: If the user does not have access to the project.\n    404: If the deployment is not found for this project.","operationId":"get_deployment_projects__project_id__deployments__deployment_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deployment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/deployments/{deployment_id}/rollback":{"post":{"tags":["deployments"],"summary":"Rollback to a previous deployment","description":"Re-deploy the model from a previous deployment record.\n\nThe rolled-back deployment may be either a training-job deployment or a\nbase-model deployment; this endpoint handles both shapes by mirroring\nwhichever target was set on the source record.\n\nArgs:\n    project_id: Project to roll back.\n    deployment_id: Deployment record whose target will be re-activated.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentResponse for the new rollback deployment record.\n\nRaises:\n    400: If the historical deployment targets a base model that is no\n        longer in the catalog.\n    403: If the user does not have access to the project.\n    404: If the deployment record is not found for this project.","operationId":"rollback_deployment_projects__project_id__deployments__deployment_id__rollback_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deployment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/deployments/options":{"get":{"tags":["felix-deprecated"],"summary":"[Removed] Deployment provider options","description":"Removed. Provider-based deployment options no longer exist.","operationId":"get_deployment_options_felix_deployments_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/felix/deployments":{"post":{"tags":["felix-deprecated"],"summary":"[Removed] Create a provider deployment -- use POST /projects/{project_id}/deployments","description":"Removed. Provider-based deployment creation (Fastino/HuggingFace/Fireworks) no longer exists.\n\nThe new deployment model is a simple model-swap on a project.\nUse ``POST /projects/{project_id}/deployments`` with ``{training_job_id, reason}`` instead.","operationId":"create_deployment_felix_deployments_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"tags":["felix-deprecated"],"summary":"[Deprecated] List deployments -- use /projects/{project_id}/deployments","description":"Deprecated. Forwards to GET /projects/{project_id}/deployments.\n\nArgs:\n    project_id: Project to query (query parameter).\n    limit: Maximum records to return.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentHistoryResponse with deprecation headers.","operationId":"list_deployments_felix_deployments_get","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Project ID","title":"Project Id"},"description":"Project ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/deployments/{deployment_id}":{"get":{"tags":["felix-deprecated"],"summary":"[Deprecated] Get a deployment -- use /projects/{project_id}/deployments/{id}","description":"Deprecated. Looks up deployment by ID and forwards to new response shape.\n\nArgs:\n    deployment_id: Deployment record ID.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentResponse with deprecation headers.","operationId":"get_deployment_felix_deployments__deployment_id__get","parameters":[{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deployment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix-deprecated"],"summary":"[Removed] Delete a deployment","description":"Removed. Deployment history records are immutable and cannot be deleted.","operationId":"delete_deployment_felix_deployments__deployment_id__delete","parameters":[{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deployment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/training-jobs/{job_id}/deployments":{"get":{"tags":["felix-deprecated"],"summary":"[Deprecated] Get deployments for a training job -- use /projects/{project_id}/deployments","description":"Deprecated. Returns deployments that reference the given training job.\n\nArgs:\n    job_id: Training job ID.\n    auth: Authenticated user.\n\nReturns:\n    DeploymentHistoryResponse with deprecation headers.","operationId":"get_training_job_deployments_felix_training_jobs__job_id__deployments_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/import-from-github/list-files":{"post":{"tags":["felix","datasets"],"summary":"List Github Files","description":"List importable data files in a GitHub repository.\n\nArgs:\n    request: Contains ``repo`` (owner/repo or URL), optional ``branch``,\n        optional ``github_token``.\n    auth: Authenticated user context.\n\nReturns:\n    List of data files and the resolved default branch.\n\nRaises:\n    HTTPException: 400 on invalid repo, 502 on GitHub API errors.","operationId":"list_github_files_felix_datasets_import_from_github_list_files_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/import-from-github":{"post":{"tags":["felix","datasets"],"summary":"Import From Github","description":"Download a file from GitHub and create a Pioneer dataset.\n\nArgs:\n    request: Contains ``repo``, ``file_path``, optional ``branch``,\n        ``dataset_name``, ``github_token``.\n    auth: Authenticated user context.\n\nReturns:\n    DatasetResponse of the created dataset.\n\nRaises:\n    HTTPException: 400 on parse errors, 502 on download failures.","operationId":"import_from_github_felix_datasets_import_from_github_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/preview-from-hub":{"post":{"tags":["felix","datasets"],"summary":"Preview Dataset From Hub","description":"Preview a dataset from HuggingFace Hub without saving it.\n\nFetches the dataset and returns a preview (first 50 rows, schema, metadata)\nfor user review before confirming the import.\n\nRequires a HuggingFace API token with read access.","operationId":"preview_dataset_from_hub_felix_datasets_preview_from_hub_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFacePullRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFacePullPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/pull-from-hub":{"post":{"tags":["felix","datasets"],"summary":"Pull Dataset From Hub","description":"Pull a dataset from HuggingFace Hub and save it locally.\n\nRequires a HuggingFace API token with read access.\nOptionally accepts session_id for SSE log streaming.","operationId":"pull_dataset_from_hub_felix_datasets_pull_from_hub_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFacePullRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}/push-to-hub":{"post":{"tags":["felix","datasets"],"summary":"Push Dataset To Hub","description":"Push a specific dataset version to HuggingFace Hub.\n\nArgs:\n    name: Dataset name.\n    version: Version number to push (use \"latest\" for most recent).\n\nRequires a HuggingFace API token with write access.\nThe dataset will be uploaded in Parquet format with metadata.","operationId":"push_dataset_to_hub_felix_datasets__name___version__push_to_hub_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HuggingFacePushRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDatasetToHubResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets":{"get":{"tags":["felix","datasets"],"summary":"List Datasets","description":"List all datasets for the authenticated user.\n\nBy default, returns only the latest version of each dataset.\nSet include_all_versions=True to return all versions.\nIf project_id is provided, returns datasets for that project plus orphan datasets.\n\nFailed datasets (status='failed') are hidden from the default\nresponse. They are preserved in the database — the raw upload,\n``processing_error``, and ``column_mapping`` columns stay populated\nso support tooling can replay or inspect them.\n\nPass ``include_failed=true`` to surface the caller's own failed\nrows (e.g. for an \"uploads\" / \"history\" view that wants to show\nerror details). The flag is purely a result-set toggle — it does\nnot relax the user-scoping that runs underneath, so it's safe for\nany authenticated caller. There is intentionally no admin-only\ngate; if cross-user visibility is ever needed it should be a\nseparate, explicitly-authenticated endpoint.","operationId":"list_datasets_felix_datasets_get","parameters":[{"name":"include_all_versions","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include All Versions"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project ID (includes datasets with no project)","title":"Project Id"},"description":"Filter by project ID (includes datasets with no project)"},{"name":"include_failed","in":"query","required":false,"schema":{"type":"boolean","description":"When true, include the caller's own failed datasets (status='failed'). Defaults to false so the UI never renders broken-but-clickable records that 404 on preview/analyze. The result set is always scoped to the authenticated user — this flag does NOT grant cross-user visibility, so passing true is safe for any authenticated caller. Failed rows remain in the database for support / debugging; their original upload is preserved at raw_s3_key.","default":false,"title":"Include Failed"},"description":"When true, include the caller's own failed datasets (status='failed'). Defaults to false so the UI never renders broken-but-clickable records that 404 on preview/analyze. The result set is always scoped to the authenticated user — this flag does NOT grant cross-user visibility, so passing true is safe for any authenticated caller. Failed rows remain in the database for support / debugging; their original upload is preserved at raw_s3_key."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/upload/url":{"post":{"tags":["felix","datasets"],"summary":"Get Upload Url","description":"Get presigned S3 URL for direct dataset upload (bypasses API Gateway limits).\n\n**Two-step upload flow:**\n1. Call this endpoint to get presigned URL and dataset_id\n2. Upload file directly to S3 using the presigned URL (HTTP PUT)\n3. Call /upload/process with dataset_id to trigger validation/processing\n\n**Auto-versioning behavior:**\n- If dataset_name is new: creates version 1\n- If dataset_name exists: creates next version (e.g., 2, 3, etc.)\n\n**Response:**\n- presigned_url: S3 PUT URL for direct upload\n- dataset_id: Use this in /upload/process\n- version_number: Dataset version\n- expires_in: URL valid for this many seconds (default: 3600 = 1 hour)\n\nSupports JSONL, CSV, JSON, and Parquet formats.","operationId":"get_upload_url_felix_datasets_upload_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUploadUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUploadUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/upload/process":{"post":{"tags":["felix","datasets"],"summary":"Process Uploaded Dataset","description":"Process dataset uploaded to S3 via presigned URL.\n\n**Prerequisites:**\n1. Must have called /upload/url to get dataset_id\n2. Must have uploaded file to S3 using presigned URL\n\n**Response:**\n- Returns 202 Accepted with dataset in \"uploading\" status\n- Poll GET /{name}/{version} to check processing status\n- Status will change to \"ready\" when complete or \"failed\" on error\n\n**Processing:**\n- Validates file exists in S3\n- Converts to Parquet if needed (CSV/JSONL/JSON → Parquet)\n- Extracts metadata (row count, schema, etc.)\n- Validates data against expected schema if provided\n- Updates database status throughout","operationId":"process_uploaded_dataset_felix_datasets_upload_process_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUploadProcessRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/merge":{"post":{"tags":["felix","datasets"],"summary":"Merge Datasets","description":"Merge multiple datasets of the same type into a single new dataset.\n\nConcatenates all rows from the source datasets into a new dataset.\nAll source datasets must share the same dataset_type (NER, classification, etc.).\n\nArgs:\n    request: Merge request with source datasets and output name.\n\nReturns:\n    DatasetMergeResponse with the new dataset details.","operationId":"merge_datasets_felix_datasets_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetMergeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetMergeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}":{"get":{"tags":["felix","datasets"],"summary":"List Dataset Versions","description":"List all versions of a dataset.\n\nArgs:\n    name: Dataset name.","operationId":"list_dataset_versions_felix_datasets__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetVersionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["felix","datasets"],"summary":"Create Dataset Version","description":"Create a new version of an existing dataset.\n\nArgs:\n    name: Dataset name.\n\nCreates a new version linked to the existing dataset.\nUse POST /upload with the same dataset_name for auto-versioning behavior.","operationId":"create_dataset_version_felix_datasets__name__post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_dataset_version_felix_datasets__name__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix","datasets"],"summary":"Delete Dataset","description":"Soft-delete a dataset and all its versions.\n\nArgs:\n    name: Dataset name. Legacy UUID lookups are still accepted and routed\n        through the by-ID path for backwards compatibility.","operationId":"delete_dataset_felix_datasets__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}":{"get":{"tags":["felix","datasets"],"summary":"Get Dataset","description":"Get metadata for a specific dataset version.\n\nArgs:\n    name: Dataset name.\n    version: Version number (use \"latest\" for most recent).","operationId":"get_dataset_felix_datasets__name___version__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["felix","datasets"],"summary":"Update Dataset Metadata","description":"Update dataset metadata without creating a new version.\n\nName changes propagate to all versions.\n\nArgs:\n    name: Dataset name.\n    version: Version number to update (use \"latest\" for most recent).","operationId":"update_dataset_metadata_felix_datasets__name___version__put","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetMetadataUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix","datasets"],"summary":"Delete Dataset Version","description":"Delete a specific version of a dataset.\n\nArgs:\n    name: Dataset name.\n    version: Version number to delete.","operationId":"delete_dataset_version_felix_datasets__name___version__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}/download":{"get":{"tags":["felix","datasets"],"summary":"Download Dataset","description":"Download a specific dataset version in the specified format.\n\nArgs:\n    name: Dataset name.\n    version: Version number (use \"latest\" for most recent).\n    format: Output format (jsonl, csv, parquet). Default: jsonl.\n\nResponse headers include:\n    - X-Dataset-Version: The version number downloaded\n    - X-Dataset-Total-Versions: Total number of versions available","operationId":"download_dataset_felix_datasets__name___version__download_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"format","in":"query","required":false,"schema":{"enum":["jsonl","csv","parquet"],"type":"string","default":"jsonl","title":"Format"}},{"name":"standard_columns","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Standard Columns"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}/preview":{"get":{"tags":["felix","datasets"],"summary":"Preview Dataset","description":"Preview rows from a dataset without downloading the full file.\n\nArgs:\n    name: Dataset name.\n    version: Version number (use \"latest\" for most recent).\n    limit: Number of rows to return (1-100, default 10).\n    offset: Number of rows to skip (default 0).\n\nReturns:\n    JSON with dataset metadata and preview rows.","operationId":"preview_dataset_felix_datasets__name___version__preview_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of rows to preview (max 100)","default":10,"title":"Limit"},"description":"Number of rows to preview (max 100)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of rows to skip","default":0,"title":"Offset"},"description":"Number of rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{dataset_id}":{"patch":{"tags":["felix","datasets"],"summary":"Update Dataset","description":"Patch a dataset by ID. Currently exposes only ``project_id``.\n\nDelegates to :func:`services.projects.movement.assign_resource_to_project`\nwhich owns the visibility check, target-project gating, and the\nservice-role ``UPDATE``. Send ``project_id: null`` to unassign the\ndataset from its project.","operationId":"update_dataset_felix_datasets__dataset_id__patch","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{name}/{version}/rows":{"patch":{"tags":["felix","datasets"],"summary":"Update Dataset Rows","description":"Update specific rows in a dataset without re-uploading the entire dataset.\n\nThis is more efficient than creating a new version for small edits.\nOnly the specified rows are modified; all other rows remain unchanged.\n\nArgs:\n    name: Dataset name.\n    version: Version number to update (use \"latest\" for most recent).\n    request: List of row updates with row_index and changes.\n\nReturns:\n    DatasetRowsUpdateResponse with update status.","operationId":"update_dataset_rows_felix_datasets__name___version__rows_patch","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetRowsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetRowsUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["felix","datasets"],"summary":"Delete Dataset Rows","description":"Delete specific rows from a dataset, creating a new version.\n\nSupports two modes: index-based (``row_indices``) for backwards\ncompatibility and fingerprint-based (``fingerprints``) for safe\ndeletion that is immune to dataset mutations between analysis and\ndelete.\n\nArgs:\n    name: Dataset name.\n    version: Version number (use \"latest\" for most recent).\n    request: Exactly one of ``row_indices`` or ``fingerprints``.\n\nReturns:\n    DatasetRowsDeleteResponse with deletion status and new version.\n\nRaises:\n    HTTPException: 400 if identifiers are invalid, 404 if not found.","operationId":"delete_dataset_rows_felix_datasets__name___version__rows_delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetRowsDeleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetRowsDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/felix/datasets/{dataset_id}/type":{"patch":{"tags":["felix","datasets"],"summary":"Update Dataset Use Type","description":"Change a dataset's use type between training and evaluation.\n\nArgs:\n    dataset_id: UUID of the dataset to update.\n    request: New use type ('training' or 'evaluation').\n\nReturns:\n    DatasetTypeUpdateResponse with the updated id and type.\n\nRaises:\n    HTTPException: 404 if the dataset is not found or not owned by the user.\n    HTTPException: 500 on unexpected database error.","operationId":"update_dataset_use_type_felix_datasets__dataset_id__type_patch","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUseTypeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetTypeUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects":{"get":{"tags":["projects"],"summary":"List Projects","description":"List all projects visible to the authenticated user.\n\nReturns team projects (visibility=team) and the user's own private projects,\nscoped to the user's team, sorted by creation date (most recent first).\nLazily provisions the pioneer/auto router if routing is live but the project\nis absent (handles silent creation failures at registration time).","operationId":"list_projects_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectListResponse"}}}}}},"post":{"tags":["projects"],"summary":"Create Project","description":"Create a new project for the authenticated user.\n\nDelegates to ``ProjectService`` for business logic, example generation,\nactivity recording, and failure analytics.\n\nArgs:\n    request: Validated project creation payload.\n    auth: Authentication result.\n\nReturns:\n    ProjectResponse for the newly created project.\n\nRaises:\n    HTTPException: 409 on duplicate name, 500 on unexpected errors.","operationId":"create_project_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get Project","description":"Get a specific project by ID.\n\nReturns the project if the user can see it (team member + visibility check).\nPrivate projects are only visible to the creator.","operationId":"get_project_projects__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects"],"summary":"Update Project","description":"Update a project's metadata.\n\nOnly provided fields will be updated. Project names must remain unique\nper team (the ``unique_active_project_name_per_team`` index): no two\nprojects in the same team may share a name. User must be a member of\nthe project's team.","operationId":"update_project_projects__project_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Project","description":"Soft-delete a project by setting is_deleted=True.\n\nThe project row is preserved in the database but hidden from all\nread queries. Associated resources (datasets, training\njobs) remain linked and are unaffected.\n\nThe project owner can always soft-delete their own project. Other\nteam members must hold ``TeamPermission.DELETE_RESOURCES`` in the\nproject's team — granted to ``owner``, ``admin``, and ``editor``.\n\nArgs:\n    project_id: Project UUID to soft-delete.\n    auth: Authentication result.\n\nReturns:\n    ProjectDeleteResponse confirming the deletion.\n\nRaises:\n    HTTPException: 404 when no visible, non-deleted project matches\n        ``project_id`` for the caller; 403 when the caller is not the\n        project owner and lacks ``DELETE_RESOURCES``; 500 on\n        transient infrastructure errors.","operationId":"delete_project_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/dataset-count":{"get":{"tags":["projects"],"summary":"Get Project Dataset Count","description":"Get the number of datasets attached to a project.\n\nUseful for checking if a project can be safely deleted.\nWorks for all team projects the user can see.","operationId":"get_project_dataset_count_projects__project_id__dataset_count_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDatasetCountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/improvement-timeseries":{"get":{"tags":["projects"],"summary":"Grouped training-job + evals + base-model-eval for a project","description":"Return training jobs grouped with their evaluations for the quality chart.\n\nIncludes the latest completed base-model evaluation so the frontend\ncan pin it as the leftmost point on the improvement curve.\n\nArgs:\n    project_id: Project UUID.\n    auth: Authentication result.\n\nReturns:\n    ImprovementTimeseriesResponse with adapters ordered newest first.\n\nRaises:\n    HTTPException 403: User lacks access to the project.\n    HTTPException 404: Project not found or deleted.","operationId":"get_improvement_timeseries_projects__project_id__improvement_timeseries_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImprovementTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitoring/improvement-candidates":{"get":{"tags":["monitoring"],"summary":"List deployable improvement candidates for monitoring","description":"List workspace-scoped monitoring improvement candidates.\n\nArgs:\n    limit: Requested maximum number of candidates.\n    auth: Authentication result.\n    service: Improvement-candidates service.\n\nReturns:\n    ImprovementCandidatesResponse with zero or more candidates.","operationId":"list_improvement_candidates_monitoring_improvement_candidates_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Maximum candidates to return, capped at 50.","default":10,"title":"Limit"},"description":"Maximum candidates to return, capped at 50."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImprovementCandidatesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitoring/improvement-candidates/{training_job_id}/dismiss":{"post":{"tags":["monitoring"],"summary":"Dismiss a monitoring improvement candidate","description":"Dismiss a visible improvement candidate training job.\n\nArgs:\n    training_job_id: Training job ID backing the candidate.\n    auth: Authentication result.\n    service: Improvement-candidates service.\n\nReturns:\n    DismissImprovementCandidateResponse with dismissal metadata.\n\nRaises:\n    HTTPException: 404 when the candidate is not visible to the caller.","operationId":"dismiss_improvement_candidate_monitoring_improvement_candidates__training_job_id__dismiss_post","parameters":[{"name":"training_job_id","in":"path","required":true,"schema":{"type":"string","title":"Training Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissImprovementCandidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cli/telemetry":{"post":{"tags":["cli"],"summary":"Cli Telemetry","description":"Receive CLI telemetry and forward to Datadog.\n\nOptionally enriched with user info if X-API-Key header is provided.\nGeographic info derived from request IP by Datadog.","operationId":"cli_telemetry_cli_telemetry_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTelemetryEvent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mle-agent/tools":{"get":{"tags":["MLE Agent"],"summary":"List Tools","description":"List available tools for a client type.\n\nArgs:\n    request: Incoming HTTP request (required by SlowAPI rate limiter).\n    params: Query parameters including client_type ('web' or 'cli')\n\nReturns:\n    List of available tools","operationId":"list_tools_mle_agent_tools_get","parameters":[{"name":"client_type","in":"query","required":false,"schema":{"type":"string","default":"web","title":"Client Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mle-agent/sessions":{"get":{"tags":["agent-chat-sessions"],"summary":"List Sessions","description":"List all chat sessions for the authenticated user.\n\nReturns sessions sorted by updated_at (most recent first). Each session\nincludes ``first_user_attached_resources`` populated from the preamble\nof its first user message so the threads-sidebar preview can render\nthe same chips that appear inside the chat history.","operationId":"list_sessions_mle_agent_sessions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of sessions to return","default":10,"title":"Limit"},"description":"Number of sessions to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","description":"Include archived sessions","default":false,"title":"Include Archived"},"description":"Include archived sessions"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["agent-chat-sessions"],"summary":"Create Session","description":"Create a new chat session.\n\nIf title is not provided, it will be auto-generated from the first_message.","operationId":"create_session_mle_agent_sessions_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mle-agent/sessions/{session_id}":{"get":{"tags":["agent-chat-sessions"],"summary":"Get Session","description":"Get a specific chat session with all messages.\n\nOnly returns sessions owned by the authenticated user.","operationId":"get_session_mle_agent_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionWithMessages"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["agent-chat-sessions"],"summary":"Update Session","description":"Update a chat session's title or archive status.","operationId":"update_session_mle_agent_sessions__session_id__patch","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-chat-sessions"],"summary":"Delete Session","description":"Delete a chat session and all its messages.\n\nMessages are automatically cascade-deleted by the database.","operationId":"delete_session_mle_agent_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mle-agent/sessions/{session_id}/messages":{"post":{"tags":["agent-chat-sessions"],"summary":"Append Messages","description":"Append messages to an existing session.\n\nMessages are added with sequential message_index values.","operationId":"append_messages_mle_agent_sessions__session_id__messages_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionMessagesAppend"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionMessagesAppendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mle-agent/sessions/{session_id}/billing/agent-turn":{"post":{"tags":["agent-chat-sessions"],"summary":"Report Mle Agent Turn Billing","description":"Crash-safe per-turn billing endpoint for MLE chat sessions.\n\nEach LLM call inside the sandbox POSTs its usage here as it\ncompletes, instead of waiting for the WebSocket ``done`` event.\nA sandbox SIGKILL / OOM mid-turn no longer drops every consumed\ntoken: only the in-flight iteration is lost, every earlier one\nis durable in the ``requests`` table.\n\nAuthenticated with the user's ``pio_sk_`` API key via\n:class:`FlexibleAuth`. The session ownership check in\n:func:`bill_mle_agent_turn` is the second layer of defence — a\nstolen API key cannot bill *other* users' chats.\n\nRate-limited at 120 req/min, the same admission ceiling as the\nauto-agent per-turn endpoint. A single user's sandbox emitting\none turn per second still has 2× headroom on bursts.\n\nArgs:\n    request: FastAPI request used by the rate-limiter.\n    session_id: ``agent_chat_sessions.id`` for the active chat.\n    body: ``AgentTurnBillingRequest`` with provider, model,\n        input / output tokens, and a per-turn dedup key.\n    auth: Authenticated caller; ``user_id`` must own ``session_id``.\n\nReturns:\n    :class:`AgentTurnBillingResponse` carrying the\n    ``requests.id`` and whether this call inserted a fresh row\n    (``billed=True``) or hit the dedup cache (``billed=False``).\n\nRaises:\n    HTTPException 404: session does not exist.\n    HTTPException 403: session belongs to a different user.\n    HTTPException 500: unexpected internal failure (callers may\n        retry the same ``(session_id, turn_id)`` safely — the\n        dedup cache makes the second call a no-op).","operationId":"report_mle_agent_turn_billing_mle_agent_sessions__session_id__billing_agent_turn_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaderboard/competitions":{"get":{"tags":["leaderboard"],"summary":"List Competitions","description":"List all active competition datasets with their top scores.\n\nArgs:\n    include_samples: If True, fetch sample rows from S3 for preview.\n        Defaults to False for fast loading.\n\nReturns datasets where is_competition=true, along with the current winner\nand optionally a few sample rows for preview.","operationId":"list_competitions_leaderboard_competitions_get","parameters":[{"name":"include_samples","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Samples"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaderboard/competitions/{dataset_id}/samples":{"get":{"tags":["leaderboard"],"summary":"Get Competition Samples","description":"Fetch sample rows for a single competition dataset.\n\nThis is the lazy-load endpoint called when a user clicks\n\"View Sample Data\" on a competition card.\n\nArgs:\n    dataset_id: The competition dataset to fetch samples for.\n\nReturns:\n    Dict with dataset_id and sample_rows list.","operationId":"get_competition_samples_leaderboard_competitions__dataset_id__samples_get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaderboard/datasets/{dataset_id}/entries":{"get":{"tags":["leaderboard"],"summary":"Get Leaderboard Entries","description":"Get top leaderboard entries for a competition dataset.\n\nReturns entries sorted by F1 score in descending order.","operationId":"get_leaderboard_entries_leaderboard_datasets__dataset_id__entries_get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of entries to return","default":10,"title":"Limit"},"description":"Number of entries to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardEntriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaderboard/datasets/{dataset_id}/submit":{"post":{"tags":["leaderboard"],"summary":"Submit To Leaderboard","description":"Submit or update a leaderboard entry after evaluation.\n\nIf the user already has an entry for this dataset, it will be updated\nonly if the new score is better (higher F1).","operationId":"submit_to_leaderboard_leaderboard_datasets__dataset_id__submit_post","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardSubmission"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/inference-clusters":{"get":{"tags":["inference-clusters"],"summary":"List Project Inference Clusters","description":"List inference clusters for a project.\n\nArgs:\n    project_id: Project ID.\n    window: Metrics window for ranking/counts.\n    status: Optional comma-delimited status filter.\n    base_model: Optional base model filter.\n    model_id: Optional model ID filter.\n    training_job_id: Optional training job filter.\n    severity: Optional severity filter.\n    auth: Authentication result.\n\nReturns:\n    Grouped project inference clusters.\n\nRaises:\n    HTTPException: 404 for inaccessible projects.","operationId":"list_project_inference_clusters_projects__project_id__inference_clusters_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","all"],"type":"string","default":"7d","title":"Window"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-delimited statuses. Defaults to open,reopened.","title":"Status"},"description":"Comma-delimited statuses. Defaults to open,reopened."},{"name":"base_model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model"}},{"name":"model_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"}},{"name":"training_job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"enum":["high","mid","low"],"type":"string"},{"type":"null"}],"title":"Severity"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectInferenceClustersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inference-clusters/{cluster_id}":{"get":{"tags":["inference-clusters"],"summary":"Get Inference Cluster","description":"Get one inference cluster.\n\nArgs:\n    cluster_id: Cluster ID.\n    window: Metrics window for primary metrics.\n    auth: Authentication result.\n\nReturns:\n    Cluster detail.\n\nRaises:\n    HTTPException: 404 for inaccessible clusters.","operationId":"get_inference_cluster_inference_clusters__cluster_id__get","parameters":[{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","all"],"type":"string","default":"7d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceClusterDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["inference-clusters"],"summary":"Update Inference Cluster","description":"Update a cluster status.\n\nArgs:\n    cluster_id: Cluster ID.\n    request: Status update payload.\n    auth: Authentication result.\n\nReturns:\n    Updated cluster detail.","operationId":"update_inference_cluster_inference_clusters__cluster_id__patch","parameters":[{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceClusterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceClusterDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inference-clusters/{cluster_id}/examples":{"get":{"tags":["inference-clusters"],"summary":"List Inference Cluster Examples","description":"List representative examples for a cluster.\n\nArgs:\n    cluster_id: Cluster ID.\n    window: Example window.\n    limit: Maximum examples.\n    offset: Number of examples to skip.\n    include: Compact or full inference shape.\n    auth: Authentication result.\n\nReturns:\n    Paginated cluster examples.","operationId":"list_inference_cluster_examples_inference_clusters__cluster_id__examples_get","parameters":[{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","all"],"type":"string","default":"all","title":"Window"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"include","in":"query","required":false,"schema":{"enum":["compact","full"],"type":"string","default":"compact","title":"Include"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceClusterInferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inference-clusters/{cluster_id}/inferences":{"get":{"tags":["inference-clusters"],"summary":"List Inference Cluster Inferences","description":"List all member inferences or passing context for a cluster.\n\nArgs:\n    cluster_id: Cluster ID.\n    role: Member failures or pass context.\n    window: Optional inference window.\n    limit: Maximum records.\n    offset: Number of records to skip.\n    sort: Sort order.\n    include: Compact or full inference shape.\n    auth: Authentication result.\n\nReturns:\n    Paginated cluster-related inferences.","operationId":"list_inference_cluster_inferences_inference_clusters__cluster_id__inferences_get","parameters":[{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}},{"name":"role","in":"query","required":false,"schema":{"enum":["members","pass_context"],"type":"string","default":"members","title":"Role"}},{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"enum":["24h","7d","30d","all"],"type":"string"},{"type":"null"}],"description":"Optional inference window. Defaults to all for members and 30d for pass_context.","title":"Window"},"description":"Optional inference window. Defaults to all for members and 30d for pass_context."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":500,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["recent","score_asc","score_desc"],"type":"string","default":"recent","title":"Sort"}},{"name":"include","in":"query","required":false,"schema":{"enum":["compact","full"],"type":"string","default":"compact","title":"Include"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceClusterInferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inferences":{"get":{"tags":["inference-history"],"summary":"List Inference History","description":"List inference history for the authenticated user.\n\nReturns all inference records across all model types (NER, classification,\nJSON extraction, decoder) sorted by most recent first.\n\nArgs:\n    auth: Authentication result with user_id\n    limit: Maximum number of records to return (default 100, max 500)\n    offset: Number of records to skip for pagination\n    model_id: Optional filter by model ID\n    task: Optional filter by task type\n    project_id: Optional filter by project ID\n    training_job_id: Optional filter by training job ID\n    latency_min/latency_max: Inclusive latency window in ms.\n    llmaj_score_min/llmaj_score_max: Inclusive LLMAJ-score window\n        in [0.0, 1.0].\n\nReturns:\n    InferenceListResponse with paginated inference records.\n\nRaises:\n    HTTPException: 422 when ``min`` is greater than its paired\n        ``max`` — returning an empty page would silently mask the\n        caller's misordered query.","operationId":"list_inference_history_inferences_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum records to return","default":100,"title":"Limit"},"description":"Maximum records to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip","default":0,"title":"Offset"},"description":"Number of records to skip"},{"name":"model_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by model ID","title":"Model Id"},"description":"Filter by model ID"},{"name":"task","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by task type","title":"Task"},"description":"Filter by task type"},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project ID","title":"Project Id"},"description":"Filter by project ID"},{"name":"training_job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by training job ID","title":"Training Job Id"},"description":"Filter by training job ID"},{"name":"latency_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Minimum latency in ms (must be >= 0).","title":"Latency Min"},"description":"Minimum latency in ms (must be >= 0)."},{"name":"latency_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum latency in ms (must be >= 0).","title":"Latency Max"},"description":"Maximum latency in ms (must be >= 0)."},{"name":"llmaj_score_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Minimum LLM-as-Judge score in [0.0, 1.0].","title":"Llmaj Score Min"},"description":"Minimum LLM-as-Judge score in [0.0, 1.0]."},{"name":"llmaj_score_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Maximum LLM-as-Judge score in [0.0, 1.0].","title":"Llmaj Score Max"},"description":"Maximum LLM-as-Judge score in [0.0, 1.0]."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceListResponse"}}}},"503":{"description":"Inference history dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inferences/{inference_id}":{"get":{"tags":["inference-history"],"summary":"Get Inference Detail","description":"Get a single inference record by ID.\n\nArgs:\n    inference_id: The inference record UUID\n    auth: Authentication result with user_id\n\nReturns:\n    InferenceRecord with full details\n\nRaises:\n    HTTPException: 404 if inference not found or not owned by user","operationId":"get_inference_detail_inferences__inference_id__get","parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","title":"Inference Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceRecord"}}}},"404":{"description":"Inference not found."},"503":{"description":"Inference history dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inferences/{inference_id}/feedback":{"post":{"tags":["inference-history"],"summary":"Submit Inference Feedback","description":"Submit human feedback on a specific inference.\n\nMarks an inference as correct or incorrect. When marking as incorrect,\nthe expected output must be provided for downstream training data curation.\n\nArgs:\n    inference_id: The inference record UUID to annotate.\n    request: Feedback payload with verdict, optional corrected output, and notes.\n    auth: Authentication result with user_id.\n\nReturns:\n    InferenceFeedbackResponse confirming the stored feedback.\n\nRaises:\n    HTTPException: 404 if inference not found or not owned by user.","operationId":"submit_inference_feedback_inferences__inference_id__feedback_post","parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","title":"Inference Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceFeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceFeedbackResponse"}}}},"404":{"description":"Inference not found."},"422":{"description":"Invalid feedback payload."},"503":{"description":"Inference history dependency is temporarily unavailable."}}},"get":{"tags":["inference-history"],"summary":"Get Inference Feedback","description":"Get human feedback for a specific inference.\n\nArgs:\n    inference_id: The inference record UUID to look up.\n    auth: Authentication result with user_id.\n\nReturns:\n    InferenceFeedbackResponse with the stored feedback.\n\nRaises:\n    HTTPException: 404 if inference not found or no feedback submitted.","operationId":"get_inference_feedback_inferences__inference_id__feedback_get","parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","title":"Inference Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceFeedbackResponse"}}}},"404":{"description":"Feedback not found."},"503":{"description":"Inference history dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/model-metrics":{"post":{"tags":["analytics"],"summary":"Get Model Metrics","description":"Return per-model metrics for the last 24 hours.\n\nCounts, error counts, average latency, and last-inference timestamp are\nall scoped to the last 24 hours. ``latest_evaluation`` is all-time.\n\nArgs:\n    request: Batch of model ids to look up.\n    auth: Authentication result carrying the user id and team scope.\n\nReturns:\n    ``ModelMetricsResponse`` with an entry for each requested id.","operationId":"get_model_metrics_analytics_model_metrics_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetricsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetricsResponse"}}}},"503":{"description":"Model metrics dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/model-datasets":{"get":{"tags":["analytics"],"summary":"Get Model Datasets","description":"Return training + evaluation datasets for a project or base model.\n\nExactly one of ``project_id`` or ``base_model`` must be provided.\n\nArgs:\n    project_id: Scope to datasets directly attached to this project,\n        or the sentinel ``\"default\"`` for unallocated datasets.\n    base_model: Scope to datasets used by training jobs and\n        evaluations against this base model id.\n    auth: Authentication result carrying the user id and team scope.\n\nReturns:\n    ``ModelDatasetsResponse`` with training and evaluation dataset\n    rows. Evaluation rows include their latest completed evaluation\n    when available.","operationId":"get_model_datasets_analytics_model_datasets_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project UUID. Returns datasets attached to this project. Pass the literal value 'default' to return datasets whose project_id is null (the unallocated-resources bucket).","title":"Project Id"},"description":"Project UUID. Returns datasets attached to this project. Pass the literal value 'default' to return datasets whose project_id is null (the unallocated-resources bucket)."},{"name":"base_model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Base catalog model id (e.g. 'meta-llama/Llama-3-8B').","title":"Base Model"},"description":"Base catalog model id (e.g. 'meta-llama/Llama-3-8B')."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDatasetsResponse"}}}},"400":{"description":"Exactly one scope parameter must be provided."},"503":{"description":"Model datasets dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/workspace-metrics":{"get":{"tags":["analytics"],"summary":"Get Workspace Metrics","description":"Return per-user KPI metrics for the monitoring page.\n\nAggregates every inference belonging to the authenticated user over the\nselected ``window`` and the immediately preceding window of equal length\n(for trend deltas), plus an all-time count for the caption. The service\nexplicitly filters ``inferences``/``requests`` by ``user_id`` — the\n``service_role`` async engine bypasses Postgres RLS, so RLS cannot be\nrelied on for tenant isolation.\n\nArgs:\n    window: Rolling window key driven by the monitoring page picker.\n    auth: Authentication result carrying the user id used to scope\n        every aggregate.\n\nReturns:\n    ``WorkspaceMetrics`` populated with current / previous / all-time\n    counts, p99 / median latency, spend, and the open-issue tally. For\n    ``window='all'`` the previous-window aggregates run against the same\n    unbounded all-time range, so each ``*_previous`` field equals its\n    current counterpart.","operationId":"get_workspace_metrics_analytics_workspace_metrics_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","90d","all"],"type":"string","description":"Rolling window for the KPI rollup. ``24h``/``7d``/``30d``/``90d`` produce a current window of that length plus a previous window of equal length for trend deltas. ``all`` runs both the current and previous aggregates against the unbounded all-time window, so each ``*_previous`` field equals its current counterpart and the UI hides the resulting zero deltas.","default":"24h","title":"Window"},"description":"Rolling window for the KPI rollup. ``24h``/``7d``/``30d``/``90d`` produce a current window of that length plus a previous window of equal length for trend deltas. ``all`` runs both the current and previous aggregates against the unbounded all-time window, so each ``*_previous`` field equals its current counterpart and the UI hides the resulting zero deltas."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMetrics"}}}},"503":{"description":"Workspace metrics dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/quality-timeseries":{"get":{"tags":["analytics"],"summary":"Get Quality Timeseries","description":"Return bucketed LLM-as-Judge quality metrics for a model.\n\nEach bucket reports the average ``llmaj_score``, the fraction of\njudged inferences with ``llmaj_verdict = 'pass'``, and the count of\nscored inferences. ``model_id`` is resolved against ``training_jobs``\nto determine whether to filter ``inferences`` by ``project_id``,\n``training_job_id``, or ``model_id`` (raw base traffic).\n\nArgs:\n    model_id: Training-job UUID or base catalog id.\n    interval: ``date_trunc`` bucket size.\n    since: Inclusive start of the window.\n    until: Exclusive end of the window.\n    auth: Authentication result carrying the user id used to scope\n        every aggregate.\n\nReturns:\n    ``QualityTimeSeriesResponse`` with descending buckets. An empty\n    ``series`` is returned when no inference rows match.","operationId":"get_quality_timeseries_analytics_quality_timeseries_get","parameters":[{"name":"model_id","in":"query","required":true,"schema":{"type":"string","description":"Training-job UUID (task model) or base catalog id (e.g. 'meta-llama/Llama-3-8B').","title":"Model Id"},"description":"Training-job UUID (task model) or base catalog id (e.g. 'meta-llama/Llama-3-8B')."},{"name":"interval","in":"query","required":false,"schema":{"enum":["day","week"],"type":"string","description":"Bucket size used for ``date_trunc``.","default":"day","title":"Interval"},"description":"Bucket size used for ``date_trunc``."},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive start of the window (UTC). Defaults to 90 days ago.","title":"Since"},"description":"Inclusive start of the window (UTC). Defaults to 90 days ago."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive end of the window (UTC). Defaults to now.","title":"Until"},"description":"Exclusive end of the window (UTC). Defaults to now."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityTimeSeriesResponse"}}}},"400":{"description":"Invalid time window."},"503":{"description":"Quality timeseries dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/clarify":{"post":{"tags":["auto-agent"],"summary":"Clarify","description":"Stream the clarification agent response as Server-Sent Events.\n\nEach event is a JSON object preceded by ``data: `` and terminated by two\nnewlines.  Two event types are emitted:\n\n- ``{\"type\": \"delta\", \"content\": \"...\"}`` — streamed token(s).\n- ``{\"type\": \"complete\", ...}`` — final summary with answer, interrupt\n  data, and run_id / results_url if the agent triggered a run.\n\nWhen a run is triggered, a background task is scheduled via\n``asyncio.create_task`` (FastAPI BackgroundTasks is incompatible with\nStreamingResponse).\n\nArgs:\n    request: FastAPI request (required by rate limiter).\n    body: Chat request with message, optional resume_value, and history.\n    auth: Authenticated user.\n\nReturns:\n    StreamingResponse with ``text/event-stream`` content type.\n\nRaises:\n    HTTPException: 400 if neither message nor resume_value is provided.","operationId":"clarify_auto_agent_clarify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAgentClarifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run":{"post":{"tags":["auto-agent"],"summary":"Start Run Direct","description":"Directly launch an Auto Agent run from a complete task description.\n\nThis endpoint intentionally bypasses the clarification agent. It is meant\nfor programmatic experiments and test harnesses that already know exactly\nwhat the Auto Agent should do.\n\nArgs:\n    request: FastAPI request (required by rate limiter).\n    body: Complete Auto Agent task description and optional history.\n    background_tasks: FastAPI background tasks for the sandbox launch.\n    auth: Authenticated user.\n\nReturns:\n    Newly created run ID, project ID, and results URL.","operationId":"start_run_direct_auto_agent_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAgentRunRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAgentRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/complete":{"post":{"tags":["auto-agent"],"summary":"Complete Run","description":"Sandbox completion callback — called by the Modal agent when it finishes.\n\nValidates the one-time callback token, writes results to the DB, and clears\nthe token. No user auth required — the token IS the auth.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: JSON payload with deliverables_json, final_report, curation_report,\n          tool_calls_made, message_history, error_message.\n    callback_token: One-time token issued at run creation (X-Callback-Token header).\n\nRaises:\n    HTTPException 401: Token invalid or already used.\n    HTTPException 404: Run not found.\n    HTTPException 400: Validation error.","operationId":"complete_run_auto_agent_run__run_id__complete_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/runs":{"get":{"tags":["auto-agent"],"summary":"List Runs Endpoint","description":"List all Auto Agent runs for the authenticated user.\n\nArgs:\n    limit: Max runs to return (default 50).\n    offset: Pagination offset.\n    auth: Authenticated user.\n\nReturns:\n    List of run summaries, most recent first.","operationId":"list_runs_endpoint_auto_agent_runs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAgentRunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}":{"get":{"tags":["auto-agent"],"summary":"Get Run Status","description":"Get the status and results of an Auto Agent run.\n\nPoll this endpoint to check if the run is still running or has completed.\nWhen the run is active and new logs exist, schedules a background task to\ngenerate an AI progress summary.\n\nArgs:\n    run_id: UUID of the run to check.\n    background_tasks: FastAPI background tasks for async summary generation.\n    auth: Authenticated user (ownership is enforced).\n\nReturns:\n    Current run status and results if complete.\n\nRaises:\n    HTTPException: 404 if run not found or not owned by user.","operationId":"get_run_status_auto_agent_run__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAgentRunStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/billing/agent-turn":{"post":{"tags":["auto-agent"],"summary":"Report Agent Turn Billing","description":"Bill a single LLM turn from inside the agent sandbox.\n\nCrash-safety mechanism: sandboxes call this endpoint *per turn*\ninstead of accumulating tokens for the entire run and posting them\nat ``/complete``. A SIGKILL after N turns now costs at most one\nin-flight turn's tokens; the previous N-1 are already durable in\nthe ``requests`` table.\n\nAuth: the same one-time ``X-Callback-Token`` issued at run creation\nthat gates the other ``/auto-agent/run/{run_id}/...`` callbacks.\nNo bearer token / API key is involved — the sandbox runs untrusted\ncode and intentionally has no credentials beyond this token.\n\nDedup: ``(run_id, body.turn_id)`` is cached in ``dedup_cache`` so\ntransport retries from the sandbox cannot double-bill. The legacy\nend-of-run fan-out path consults the same cache and skips already\nbilled turns, so the safety net is idempotent.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: Per-turn token usage payload.\n    callback_token: Sandbox callback token from\n        ``X-Callback-Token`` header.\n\nRaises:\n    HTTPException 401: Callback token invalid or run finalized.\n    HTTPException 404: Run not found.","operationId":"report_agent_turn_billing_auto_agent_run__run_id__billing_agent_turn_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/stop":{"post":{"tags":["auto-agent"],"summary":"Stop Run Endpoint","description":"Stop a running Auto Agent by terminating its Modal sandbox.\n\nArgs:\n    request: FastAPI request (required by rate limiter).\n    run_id: UUID of the run to stop.\n    auth: Authenticated user (ownership is enforced).\n\nRaises:\n    HTTPException: 404 if run not found, 400 if not running.","operationId":"stop_run_endpoint_auto_agent_run__run_id__stop_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sandbox-agents/{agent_type}/runs/{run_ref_id}/billing/agent-turn":{"post":{"tags":["sandbox-agents"],"summary":"Report Keyed Agent Turn Billing","description":"Bill one LLM turn from a keyed sandbox-script agent.\n\nThe sandboxed agent calls this once per LangChain\n``on_chat_model_end`` event so usage is durable in ``requests``\nbefore the next iteration starts. A SIGKILL after N turns now\ncosts at most one in-flight turn — N-1 are already in the\ntable.\n\nThe legacy end-of-run fan-out remains as a safety net for any\niteration whose POST failed (network / timeout / 5xx). The\nfan-out dedups against the same cache namespace this endpoint\nwrites to, so a turn that *did* land per-iteration and is then\nreplayed end-of-run cannot be billed twice.\n\nArgs:\n    agent_type: Which keyed agent fired the call. Validated by\n        :data:`KeyedAgentType` — unknown values 422 rather than\n        silently billing under a wildcard category.\n    run_ref_id: Client-generated UUID identifying the run /\n        conversation (typically the LangGraph ``thread_id``).\n        Used as the dedup namespace and the workload reference\n        on the resulting ``requests`` row.\n    body: Token usage payload (turn_id, provider, model,\n        input_tokens, output_tokens). Same schema the MLE and\n        auto-agent endpoints use; we deliberately reuse it.\n    auth: Authenticated user (from ``X-API-Key``). Their UUID\n        is the billable principal; their primary team is\n        resolved by the service layer.\n\nRaises:\n    HTTPException 500: Anything unexpected. The sandbox MUST\n        retry on 5xx (the shared\n        :class:`SandboxBillingClient` already does once); only\n        persistent failure falls through to the legacy fan-out.","operationId":"report_keyed_agent_turn_billing_sandbox_agents__agent_type__runs__run_ref_id__billing_agent_turn_post","parameters":[{"name":"agent_type","in":"path","required":true,"schema":{"enum":["clustering_agent","adaptive_finetuning","data_engine"],"type":"string","title":"Agent Type"}},{"name":"run_ref_id","in":"path","required":true,"schema":{"type":"string","title":"Run Ref Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTurnBillingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/log":{"post":{"tags":["auto-agent"],"summary":"Append Sandbox Log","description":"Append a log line streamed from inside the sandbox.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: ``{\"line\": \"...\"}``.\n    callback_token: One-time token issued at run creation.\n\nRaises:\n    HTTPException 401: Token invalid or run already finalized.\n    HTTPException 404: Run not found.","operationId":"append_sandbox_log_auto_agent_run__run_id__log_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SandboxLogRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/phase":{"post":{"tags":["auto-agent"],"summary":"Update Sandbox Phase","description":"Update the high-level progress phase visible to the user.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: ``{\"phase\": \"analyzing\"}``.\n    callback_token: One-time token issued at run creation.\n\nRaises:\n    HTTPException 401: Token invalid or run already finalized.\n    HTTPException 404: Run not found.","operationId":"update_sandbox_phase_auto_agent_run__run_id__phase_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SandboxPhaseRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/workspace-files":{"post":{"tags":["auto-agent"],"summary":"Sync Sandbox Workspace Files","description":"Sync partial workspace files so the UI can show progress mid-run.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: Optional fields ``deliverables_json``, ``final_report``,\n        ``curation_report`` — missing fields preserve the existing value.\n    callback_token: One-time token issued at run creation.\n\nRaises:\n    HTTPException 401: Token invalid or run already finalized.\n    HTTPException 404: Run not found.","operationId":"sync_sandbox_workspace_files_auto_agent_run__run_id__workspace_files_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SandboxWorkspaceFilesRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/partial-results":{"post":{"tags":["auto-agent"],"summary":"Save Sandbox Partial Results","description":"Save partial deliverables when the sandbox is interrupted (timeout/SIGTERM).\n\nIf all three result files (``deliverables_json``, ``final_report``,\n``curation_report``) are present, the run is marked ``complete``.\nOtherwise the run flips to ``failed`` (only when still ``running`` —\na concurrent ``stop_run`` keeps its ``stopped`` status) with whatever\npartial data was provided.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: Partial results payload + ``error_message``.\n    callback_token: One-time token issued at run creation.\n\nRaises:\n    HTTPException 401: Token invalid or run already finalized.\n    HTTPException 404: Run not found.","operationId":"save_sandbox_partial_results_auto_agent_run__run_id__partial_results_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SandboxPartialResultsRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auto-agent/run/{run_id}/fail":{"post":{"tags":["auto-agent"],"summary":"Fail Sandbox Run","description":"Mark a run as failed when the agent itself catches an unrecoverable error.\n\nArgs:\n    run_id: Run UUID from the path.\n    body: ``{\"error_message\": \"...\"}``.\n    callback_token: One-time token issued at run creation.\n\nRaises:\n    HTTPException 401: Token invalid or run already finalized.\n    HTTPException 404: Run not found.","operationId":"fail_sandbox_run_auto_agent_run__run_id__fail_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SandboxFailRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clustering/run":{"post":{"tags":["clustering"],"summary":"Run Clustering","description":"Reject the retired manual clustering agent endpoint.\n\nThe supported production path is event-driven: LLMAJ stores a not-pass\nverdict, enqueues ``inference_cluster_refresh``, and the worker updates\n``InferenceCluster`` rows for the project/model variant scope.\n\nArgs:\n    request: FastAPI request (required by rate limiter).\n    auth: Authenticated user.\n\nRaises:\n    HTTPException: Always raised with 410 Gone.","operationId":"run_clustering_clustering_run_post","responses":{"410":{"description":"Legacy manual clustering agent is retired.","content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object","required":["detail"]}}}}},"deprecated":true}},"/custom-enums":{"get":{"tags":["custom-enums"],"summary":"List Custom Enums","description":"List all custom enums for the authenticated user.\n\nReturns enums sorted by name.","operationId":"list_custom_enums_custom_enums_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumListResponse"}}}}}},"post":{"tags":["custom-enums"],"summary":"Create Custom Enum","description":"Create a new custom enum for the authenticated user.\n\nEnum names must be unique per user.","operationId":"create_custom_enum_custom_enums_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/custom-enums/{enum_id}":{"get":{"tags":["custom-enums"],"summary":"Get Custom Enum","description":"Get a specific custom enum by ID.\n\nOnly returns enums owned by the authenticated user.","operationId":"get_custom_enum_custom_enums__enum_id__get","parameters":[{"name":"enum_id","in":"path","required":true,"schema":{"type":"string","title":"Enum Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["custom-enums"],"summary":"Update Custom Enum","description":"Update a custom enum's metadata.\n\nOnly provided fields will be updated. Enum names must remain unique per user.","operationId":"update_custom_enum_custom_enums__enum_id__patch","parameters":[{"name":"enum_id","in":"path","required":true,"schema":{"type":"string","title":"Enum Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["custom-enums"],"summary":"Delete Custom Enum","description":"Delete a custom enum.","operationId":"delete_custom_enum_custom_enums__enum_id__delete","parameters":[{"name":"enum_id","in":"path","required":true,"schema":{"type":"string","title":"Enum Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEnumDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs":{"post":{"tags":["agent"],"summary":"Trigger Agent Run","description":"Manually trigger an agent run for a project.\n\nArgs:\n    request: FastAPI request (for rate limiter).\n    body: Request body with project_id.\n    auth: Authenticated user.\n    service: Agent service.\n\nReturns:\n    Trigger response with agent_run_id and status.\n\nRaises:\n    HTTPException: 429 if slot taken, 503 if disabled, 404 if project not found.","operationId":"trigger_agent_run_agent_runs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerAgentRunRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerAgentRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent"],"summary":"List Agent Runs","description":"List agent runs for the authenticated user.\n\nArgs:\n    request: FastAPI request (for rate limiter).\n    project_id: Optional project filter.\n    limit: Page size.\n    offset: Pagination offset.\n    auth: Authenticated user.\n    service: Agent service.\n\nReturns:\n    Paginated list of agent runs.","operationId":"list_agent_runs_agent_runs_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project ID","title":"Project Id"},"description":"Filter by project ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Page size","default":20,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunListResponse"}}}},"503":{"description":"Agent run dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs/{agent_run_id}":{"get":{"tags":["agent"],"summary":"Get Agent Run","description":"Get detailed agent run including deliverables.\n\nArgs:\n    request: FastAPI request (for rate limiter).\n    agent_run_id: Agent run identifier.\n    auth: Authenticated user.\n    service: Agent service.\n\nReturns:\n    Full agent run detail with report.\n\nRaises:\n    HTTPException: 404 if run not found.","operationId":"get_agent_run_agent_runs__agent_run_id__get","parameters":[{"name":"agent_run_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunDetail"}}}},"404":{"description":"Agent run not found."},"503":{"description":"Agent run dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/quality-metrics":{"get":{"tags":["agent"],"summary":"Get Quality Metrics","description":"Get LLMAJ pass/fail aggregates for a project.\n\nArgs:\n    request: FastAPI request (for rate limiter).\n    project_id: Project UUID to aggregate metrics for.\n    auth: Authenticated user.\n    service: Agent service.\n\nReturns:\n    Quality metrics response with verdict counts and rates.\n\nRaises:\n    HTTPException: 404 if project not found.","operationId":"get_quality_metrics_projects__project_id__quality_metrics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityMetricsResponse"}}}},"404":{"description":"Project not found."},"503":{"description":"Quality metrics dependency is temporarily unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs/{agent_run_id}/complete":{"post":{"tags":["agent"],"summary":"Complete Agent Run","description":"Handle sandbox completion callbacks for autonomous agent runs.\n\nArgs:\n    agent_run_id: Agent run identifier from the path.\n    payload: Completion payload from the sandbox.\n    callback_token: One-time callback authentication token.\n    execution_service: Agent execution service.\n\nReturns:\n    Callback acceptance response including resulting run status.\n\nRaises:\n    HTTPException: When callback auth fails or run is missing.","operationId":"complete_agent_run_agent_runs__agent_run_id__complete_post","parameters":[{"name":"agent_run_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Run Id"}},{"name":"X-Agent-Callback-Token","in":"header","required":true,"schema":{"type":"string","title":"X-Agent-Callback-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunCallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inference":{"post":{"tags":["inference"],"summary":"Run Inference","description":"Run inference on a fine-tuned or base Pioneer model.\n\nSupports both encoder tasks (NER, classification, JSON extraction) and\ndecoder tasks (text generation). The ``task`` field discriminates the\nrequest type automatically, and the response ``type`` field indicates\nthe result shape.\n\nAll wire-format translation, routing, dispatch, persistence, and error\nmapping live in :func:`services.inference.adapters.native.run_native_inference`. The\nrouter keeps only the HTTP-shaped concerns: route declaration,\nauthentication, rate limiting, global admission control, and the\ndeprecation-header injection that flags legacy encoder task shapes\nbefore the body is rendered.\n\nArgs:\n    request: FastAPI request object (required by SlowAPI key extraction).\n    inference_request: Discriminated union -- either encoder or decoder\n        payload.\n    background_tasks: FastAPI background-tasks queue threaded into the\n        adapter persistence layer.\n    response: FastAPI response object -- used to set deprecation headers\n        on legacy encoder task shapes before the body is rendered.\n    auth: Authenticated request context.\n\nReturns:\n    :class:`schemas.inference.EncoderInferenceResponse` for encoder\n    requests, :class:`schemas.inference.GenerateInferenceResponse` for\n    decoder requests.\n\nRaises:\n    HTTPException: If the model is not found, the inference fails, or\n        the request payload is invalid. See the adapter for the\n        full error-mapping ladder.","operationId":"run_inference_inference_post","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EncoderInferenceRequest"},{"$ref":"#/components/schemas/GenerateInferenceRequest"}],"title":"Inference Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EncoderInferenceResponse"},{"$ref":"#/components/schemas/GenerateInferenceResponse"}],"title":"Response Run Inference Inference Post","discriminator":{"propertyName":"type","mapping":{"encoder":"#/components/schemas/EncoderInferenceResponse","decoder":"#/components/schemas/GenerateInferenceResponse"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/base-models":{"get":{"tags":["model-selection"],"summary":"List Base Models","description":"Public model catalog — single source of truth for available models.\n\nReturns the union of all provider catalogs. Each model carries\n``supports_training`` and ``supports_inference`` flags derived from\n``catalog_registry``. Use query parameters to filter by capability.\n\nThe ``supports_inference`` flag and filter use\n:func:`supports_inference_runtime`, which unions\n``supports_base_inference`` across every provider entry **whose\nruntime configuration is present in the current process**. A\nfinetune-only Fireworks decoder still reports ``True`` when it is\nbridged through OpenRouter or AWS Bedrock; an Azure-only catalog\nslug (``claude-sonnet-4-5``) reports ``True`` only when the brain\nhas the Azure env vars set so the request actually has somewhere\nto go.\n\nAuthentication is **optional**. Anonymous callers receive the public\ncatalog with all feature-flag-gated entries hidden (their flags\nresolve to ``default_value=False``). Authenticated callers populate\nthe request-scoped identity ContextVars via ``FlexibleAuth`` so\nper-user / per-team / per-email Datadog Remote Config rules can match,\nexposing gated entries (e.g. Gliner-PII, Gliner Guardrails) to users\non a rollout. Bad credentials are silently downgraded to anonymous so\nthis endpoint never returns 401.\n\nExamples:\n    GET /base-models                          — full catalog\n    GET /base-models?supports_inference=true   — serverless-capable models\n    GET /base-models?supports_training=true    — trainable models\n    GET /base-models?task_type=encoder          — encoder/NER models only\n    GET /base-models?task_type=decoder          — decoder/LLM models only","operationId":"list_base_models_base_models_get","parameters":[{"name":"supports_training","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter to models that support fine-tuning","title":"Supports Training"},"description":"Filter to models that support fine-tuning"},{"name":"supports_inference","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter to models with serverless inference","title":"Supports Inference"},"description":"Filter to models with serverless inference"},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by model architecture: 'encoder' (NER/GLiNER) or 'decoder' (LLM)","title":"Task Type"},"description":"Filter by model architecture: 'encoder' (NER/GLiNER) or 'decoder' (LLM)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseModelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/completions":{"post":{"tags":["openai-compat"],"summary":"Text Completions","description":"OpenAI-compatible text completions endpoint.\n\nThin shell over :func:`services.inference.adapters.openai_text.run_text_completion`.\nThe adapter handles project routing, dispatch (LLM passthrough vs\nPioneer-task), SSE rendering, persistence, and error mapping. The\nrouter keeps only HTTP-shaped concerns: route declaration, auth,\nrate limiting.\n\nArgs:\n    body: Validated :class:`TextCompletionRequest`.\n    request: FastAPI request (forwarded so the adapter can read\n        API-key billing context out of ``request.state`` for\n        streaming responses).\n    auth: Authenticated request context.\n\nReturns:\n    :class:`TextCompletionResponse` for non-streaming, or a\n    :class:`StreamingResponse` of ``text_completion`` SSE events\n    terminated by ``data: [DONE]`` when ``body.stream`` is true.","operationId":"text_completions_v1_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextCompletionRequest"}}},"required":true},"responses":{"200":{"description":"Text completion. Returns ``application/json`` (``TextCompletionResponse``) by default, or ``text/event-stream`` of ``TextCompletionStreamChunk`` events terminated by ``data: [DONE]`` when ``stream=true``.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextCompletionResponse"}},"text/event-stream":{"schema":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"text_completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"properties":{"index":{"type":"integer","title":"Index","default":0},"text":{"type":"string","title":"Text","default":""},"logprobs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Logprobs"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content"}},"type":"object","title":"TextCompletionChoice","description":"A single text completion choice.\n\nThe OpenAI ``/v1/completions`` chunk / response schema has no\nreasoning slot. Pioneer adopts the de facto vLLM extension and\nexposes upstream reasoning on ``reasoning_content`` so this surface\nstays symmetric with ``/v1/chat/completions``\n(:class:`ChatCompletionStreamDelta` and ``message.reasoning_content``).\nStock OpenAI SDK consumers reading only ``text`` ignore the unknown\nfield; reasoning-aware consumers drain both. The streaming-chunk\nrenderer at\n:class:`~services.inference.adapters.openai_text._TextStreamRenderer`\nemits ``choices[0].reasoning_content`` on the wire for thinking\ndeltas."},"type":"array","title":"Choices"},"usage":{"anyOf":[{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","default":0},"prompt_tokens_details":{"anyOf":[{"properties":{"cached_tokens":{"type":"integer","title":"Cached Tokens","default":0},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens","default":0}},"type":"object","title":"PromptTokensDetails","description":"Per-input-class breakdown for OpenAI-shape usage payloads.\n\nMirrors OpenAI's ``prompt_tokens_details`` block and OpenRouter's\ncache-creation extension so clients reading\n``usage.prompt_tokens_details.cached_tokens`` /\n``cache_write_tokens`` keep working when Pioneer relays a cache-aware\nupstream response. Both counts are subsets of ``prompt_tokens`` on the\nwire — that's the upstream contract Pioneer relays faithfully.\n\nAttributes:\n    cached_tokens: Input tokens served from the upstream prompt cache\n        (cache read).\n    cache_write_tokens: Input tokens written into the upstream prompt\n        cache (cache creation). ``0`` for upstreams that bill writes\n        as plain input (OpenAI, Fireworks, vLLM)."},{"type":"null"}]}},"type":"object","title":"ChatCompletionUsage","description":"Token usage statistics.\n\n``prompt_tokens`` follows the upstream wire contract — *includes* every\ninput class (non-cached, cache read, and cache write). The breakdown is\nexposed under ``prompt_tokens_details`` so consumers can attribute the\ncached-read and cache-write subsets. Cache-aware billing on the brain\nside reads the canonical ``InferenceUsage`` fields directly, not this\nwire payload."},{"type":"null"}]},"x_pioneer":{"anyOf":[{"properties":{"inference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inference Id"}},"type":"object","title":"PioneerExtension","description":"Pioneer-specific extension fields appended to OpenAI-compatible responses.\n\nOpenAI's API contract reserves the unprefixed top-level keys (``id``,\n``choices``, ``usage``, …); custom data must live under a clearly\nnamespaced key. ``x_pioneer`` is that key.\n\nAttributes:\n    inference_id: The Pioneer-side identifier of the persisted\n        ``inferences`` row associated with this completion. Present\n        when persistence is enabled (``extra_body.store == True``)\n        and the row was successfully recorded; ``None`` for ad-hoc\n        requests that opted out of persistence. The frontend uses\n        this to poll ``GET /inferences/{id}`` for asynchronous\n        judge results without coupling the inference response\n        latency to the judge."},{"type":"null"}]}},"type":"object","required":["model","choices"],"title":"TextCompletionStreamChunk","description":"OpenAI-compatible text completion streaming chunk.\n\n``x_pioneer`` mirrors the field on :class:`TextCompletionResponse` and is\npopulated only on the terminal chunk when persistence ran (matching the\nchat-completions streaming contract)."},"example":"data: {\"id\":\"cmpl-abc\",\"object\":\"text_completion\",\"created\":0,\"model\":\"Qwen/Qwen3-8B-Base\",\"choices\":[{\"index\":0,\"text\":\"Hello.\",\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":1,\"completion_tokens\":1,\"total_tokens\":2}}\n\ndata: [DONE]\n\n"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/completions":{"post":{"tags":["openai-compat"],"summary":"Chat Completions","description":"OpenAI-compatible chat completions endpoint.\n\nThin shell over :func:`services.inference.adapters.openai_chat.run_chat_completion`.\nThe adapter handles LLM-passthrough vs Pioneer-task dispatch, SSE\nrendering with ``<think>...</think>`` folding for reasoning models,\ntool-call deltas, finish-reason mapping, persistence, and error\nmapping. The router keeps only HTTP-shaped concerns: route\ndeclaration, auth, rate limiting.\n\nArgs:\n    body: Validated :class:`ChatCompletionRequest`.\n    request: FastAPI request (forwarded so the adapter can read\n        API-key billing context out of ``request.state`` for\n        streaming responses).\n    auth: Authenticated request context.\n\nReturns:\n    :class:`ChatCompletionResponse` for non-streaming, or a\n    :class:`StreamingResponse` of ``chat.completion.chunk`` SSE\n    events terminated by ``data: [DONE]`` when ``body.stream``\n    is true.","operationId":"chat_completions_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"required":true},"responses":{"200":{"description":"Chat completion. Returns ``application/json`` (``ChatCompletionResponse``) by default, or ``text/event-stream`` of ``ChatCompletionStreamChunk`` events terminated by ``data: [DONE]`` when ``stream=true``.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"chat.completion.chunk"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"properties":{"index":{"type":"integer","title":"Index","default":0},"delta":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls"}},"type":"object","title":"ChatCompletionStreamDelta","description":"Incremental delta payload inside a streaming chunk's choice.\n\nThe OpenAI Chat Completions chunk schema (``ChoiceDelta`` in the\nopenai-python SDK) defines ``content``, ``function_call``,\n``refusal``, ``role``, and ``tool_calls`` — there is no spec slot\nfor reasoning. Pioneer adopts the de facto industry extension\n(vLLM, DeepSeek, Fireworks, OpenRouter, LiteLLM) and exposes\nchain-of-thought tokens on a dedicated ``reasoning_content``\nchannel, mirroring Pioneer's own input path at\n:func:`services.inference.providers.openai_compat.OpenAICompatProvider._chat_delta_to_events`\n(which already reads ``delta.reasoning_content`` from those same\nupstream providers). Stock OpenAI SDK consumers ignore the unknown\nfield; reasoning-aware consumers drain both channels. The renderer\ncontract lives on\n:class:`~services.inference.adapters.openai_chat._ChatStreamRenderer`."},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"}},"type":"object","title":"ChatCompletionStreamChoice","description":"One choice slot inside a streaming chunk."},"type":"array","title":"Choices"},"usage":{"anyOf":[{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","default":0},"prompt_tokens_details":{"anyOf":[{"properties":{"cached_tokens":{"type":"integer","title":"Cached Tokens","default":0},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens","default":0}},"type":"object","title":"PromptTokensDetails","description":"Per-input-class breakdown for OpenAI-shape usage payloads.\n\nMirrors OpenAI's ``prompt_tokens_details`` block and OpenRouter's\ncache-creation extension so clients reading\n``usage.prompt_tokens_details.cached_tokens`` /\n``cache_write_tokens`` keep working when Pioneer relays a cache-aware\nupstream response. Both counts are subsets of ``prompt_tokens`` on the\nwire — that's the upstream contract Pioneer relays faithfully.\n\nAttributes:\n    cached_tokens: Input tokens served from the upstream prompt cache\n        (cache read).\n    cache_write_tokens: Input tokens written into the upstream prompt\n        cache (cache creation). ``0`` for upstreams that bill writes\n        as plain input (OpenAI, Fireworks, vLLM)."},{"type":"null"}]}},"type":"object","title":"ChatCompletionUsage","description":"Token usage statistics.\n\n``prompt_tokens`` follows the upstream wire contract — *includes* every\ninput class (non-cached, cache read, and cache write). The breakdown is\nexposed under ``prompt_tokens_details`` so consumers can attribute the\ncached-read and cache-write subsets. Cache-aware billing on the brain\nside reads the canonical ``InferenceUsage`` fields directly, not this\nwire payload."},{"type":"null"}]},"x_pioneer":{"anyOf":[{"properties":{"inference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inference Id"}},"type":"object","title":"PioneerExtension","description":"Pioneer-specific extension fields appended to OpenAI-compatible responses.\n\nOpenAI's API contract reserves the unprefixed top-level keys (``id``,\n``choices``, ``usage``, …); custom data must live under a clearly\nnamespaced key. ``x_pioneer`` is that key.\n\nAttributes:\n    inference_id: The Pioneer-side identifier of the persisted\n        ``inferences`` row associated with this completion. Present\n        when persistence is enabled (``extra_body.store == True``)\n        and the row was successfully recorded; ``None`` for ad-hoc\n        requests that opted out of persistence. The frontend uses\n        this to poll ``GET /inferences/{id}`` for asynchronous\n        judge results without coupling the inference response\n        latency to the judge."},{"type":"null"}]}},"type":"object","required":["model","choices"],"title":"ChatCompletionStreamChunk","description":"OpenAI-compatible chat completion streaming chunk.\n\n    One of these is JSON-serialized into each ``data: {...}\n\n`` SSE event\n    emitted by the chat completions handler when ``stream=true``. The stream\n    is terminated by a literal ``data: [DONE]\n\n`` sentinel that does not\n    follow this schema.\n\n    ``x_pioneer`` mirrors the field on :class:`ChatCompletionResponse` and is\n    populated only on the terminal chunk (the one carrying ``finish_reason``)\n    when persistence ran. Intermediate chunks set it to ``None`` so SDK\n    clients can wait for the terminal frame before reading the id rather\n    than racing the early text deltas.\n    "},"example":"data: {\"id\":\"chatcmpl-abc\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"Qwen/Qwen3-8B\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hi\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-abc\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"Qwen/Qwen3-8B\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":1,\"completion_tokens\":1,\"total_tokens\":2}}\n\ndata: [DONE]\n\n"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/responses":{"post":{"tags":["openai-compat"],"summary":"Responses","description":"OpenAI-compatible Responses API endpoint.\n\nThin shell over :func:`services.inference.adapters.openai_responses.run_responses`.\nThe adapter handles input-item to chat-message translation,\nLLM-passthrough vs Pioneer-task dispatch, SSE rendering,\ntool-call serialisation, persistence, and error mapping. The\nrouter keeps only HTTP-shaped concerns: route declaration, auth,\nrate limiting.\n\nArgs:\n    body: Validated :class:`ResponsesRequest`.\n    request: FastAPI request (forwarded so the adapter can read\n        API-key billing context out of ``request.state`` for\n        streaming responses).\n    auth: Authenticated request context.\n\nReturns:\n    JSON response payload or :class:`StreamingResponse` SSE stream\n    in Responses API format.","operationId":"responses_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses":{"post":{"tags":["openai-compat"],"summary":"Responses","description":"OpenAI-compatible Responses API endpoint.\n\nThin shell over :func:`services.inference.adapters.openai_responses.run_responses`.\nThe adapter handles input-item to chat-message translation,\nLLM-passthrough vs Pioneer-task dispatch, SSE rendering,\ntool-call serialisation, persistence, and error mapping. The\nrouter keeps only HTTP-shaped concerns: route declaration, auth,\nrate limiting.\n\nArgs:\n    body: Validated :class:`ResponsesRequest`.\n    request: FastAPI request (forwarded so the adapter can read\n        API-key billing context out of ``request.state`` for\n        streaming responses).\n    auth: Authenticated request context.\n\nReturns:\n    JSON response payload or :class:`StreamingResponse` SSE stream\n    in Responses API format.","operationId":"responses_v1_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams":{"get":{"tags":["teams"],"summary":"List Teams","description":"List all teams the authenticated user is a member of.\n\nReturns teams sorted with member counts and user's role in each.","operationId":"list_teams_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamListResponse"}}}}}},"post":{"tags":["teams"],"summary":"Create Team","description":"Create a new team with the authenticated user as owner.\n\nThe creator automatically becomes the team owner.","operationId":"create_team_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}":{"get":{"tags":["teams"],"summary":"Get Team","description":"Get a specific team by ID.\n\nOnly accessible to team members.","operationId":"get_team_teams__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["teams"],"summary":"Update Team","description":"Update a team's details.\n\nRequires owner or admin role.","operationId":"update_team_teams__team_id__patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["teams"],"summary":"Delete Team","description":"Delete a team.\n\nOnly the team owner can delete a team.","operationId":"delete_team_teams__team_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members":{"get":{"tags":["teams"],"summary":"List Team Members","description":"List all members of a team.\n\nAccessible to all team members.","operationId":"list_team_members_teams__team_id__members_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMembersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members/{user_id}":{"patch":{"tags":["teams"],"summary":"Update Member Role","description":"Update a team member's role.\n\nRequires owner or admin role. Passing ``role=owner`` performs an\nownership transfer to an existing member; ordinary role updates cannot\ndirectly modify the current owner.\n\n**Accepted risk (ENG-1281):** AAL2 enforcement was intentionally removed\n(PR #3928) — users without MFA enrolled were being blocked from routine\nteam operations. Promoting a low-privilege collaborator is part of the\nL-A16 escalation chain: an AAL1 attacker on a team-admin's session could\npromote a colluding member into MANAGE_BILLING and pivot into credential\nminting. This risk is accepted per the design decision.","operationId":"update_member_role_teams__team_id__members__user_id__patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamRoleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["teams"],"summary":"Remove Team Member","description":"Remove a member from a team.\n\nRequires owner or admin role. Member eviction can lock legitimate\noperators out of audit / response\ncapabilities and is part of the L-A16 attack surface (ENG-1281).","operationId":"remove_team_member_teams__team_id__members__user_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberRemoveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/owned-resources":{"get":{"tags":["teams"],"summary":"List Owned Resources","description":"Snapshot the rows the caller owns in ``team_id`` for the leave-team UI.\n\nThe frontend's :class:`LeaveTeamModal` calls this once before\nsubmitting :func:`leave_team` to render a per-resource picker.\nResource types with zero owned rows are omitted.\n\nArgs:\n    team_id: Team the caller intends to leave.\n    auth: Authenticated user context.\n\nReturns:\n    :class:`OwnedResourcesResponse` containing\n    ``is_sole_member`` (so the UI can route directly to the\n    destructive sole-member-leave flow) and the per-resource\n    picker payload.","operationId":"list_owned_resources_teams__team_id__owned_resources_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnedResourcesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/leave":{"post":{"tags":["teams"],"summary":"Leave Team","description":"Leave a team voluntarily.\n\nRoutes to :func:`sole_member_leave_team_atomic` when the caller is\nthe only member (no transfer plan required) and to\n:func:`leave_team_atomic` otherwise. Owners cannot leave without\ntransferring ownership first — the lifecycle helper raises 400 in\nthat case.\n\nArgs:\n    team_id: Team the caller is leaving.\n    body: Optional ``{transfer_plan: {resource_type: {row_id: target|\"delete\"}}}``.\n        Required for multi-member teams when the caller owns rows;\n        ignored for sole-member teams.\n    auth: Authenticated user context.\n\nReturns:\n    :class:`TeamLeaveResponse`. ``new_active_team_id`` is the team\n    the caller's active-team snapped to (earliest remaining\n    membership) or ``None`` when they have none left.\n\nRaises:\n    HTTPException: 400 if the caller is the team owner; 404 if not\n        a member; 409 with ``{detail: \"owned_resources_unresolved\",\n        unresolved: {...}}`` when the transfer plan is incomplete;\n        409 ``transfer_target_not_member`` when a target is not a\n        current member.","operationId":"leave_team_teams__team_id__leave_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LeaveTeamRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamLeaveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/transfer-ownership/{new_owner_id}":{"post":{"tags":["teams"],"summary":"Transfer Ownership","description":"Transfer team ownership to another member.\n\nOnly the current owner can transfer ownership. The current owner becomes\nan admin after transfer.\n\n**Accepted risk (ENG-1281):** AAL2 enforcement was intentionally removed\n(PR #3928) — users without MFA enrolled were being blocked from routine\nteam operations. Ownership transfer is the highest-impact admin action;\nan AAL1 attacker on the owner's session could hand the team to a\ncolluding member and pivot into credential / billing surfaces. This risk\nis accepted per the design decision.\n\nPath params are typed as :class:`uuid.UUID` so FastAPI rejects malformed\ninputs with a clean 422 at the API boundary instead of letting them\nleak into the service and trip an asyncpg\n``invalid input syntax for type uuid`` 500 via ``_get_user_role``\n(ENG-2214 / Sentry PYTHON-1SY0).","operationId":"transfer_ownership_teams__team_id__transfer_ownership__new_owner_id__post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}},{"name":"new_owner_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"New Owner Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Transfer Ownership Teams  Team Id  Transfer Ownership  New Owner Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/invitations":{"get":{"tags":["teams"],"summary":"List Team Invitations","description":"List all invitations for a team.\n\nRequires owner, admin, or billing role.","operationId":"list_team_invitations_teams__team_id__invitations_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvitationsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["teams"],"summary":"Invite Member","description":"Invite a user to join a team.\n\nRequires owner, admin, or billing role. Owner-role invitations are\nrejected; ownership can only be transferred to an existing team member.\nSupports pre-signup invites (invitee doesn't need an account yet).\n\n**Accepted risk (ENG-1281):** AAL2 enforcement was intentionally removed\n(PR #3928) — users without MFA enrolled were being blocked from routine\nteam operations. Inviting an attacker-controlled email as\n``admin``/``billing`` is the cleanest L-A16 escalation path: the\nattacker accepts on their own AAL2 account and instantly has\nMANAGE_BILLING on the victim team. This risk is accepted per the design\ndecision.","operationId":"invite_member_teams__team_id__invitations_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvitationCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvitationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/invitations/{invitation_id}":{"delete":{"tags":["teams"],"summary":"Cancel Invitation","description":"Cancel a pending invitation.\n\nRequires owner or admin role. Cancelling pending invites is paired\nwith ``invite_member`` in the\nescalation chain (clean up the attacker's evidence, ENG-1281).","operationId":"cancel_invitation_teams__team_id__invitations__invitation_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Invitation Teams  Team Id  Invitations  Invitation Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/settings":{"patch":{"tags":["teams"],"summary":"Update Team Settings","description":"Update team settings.\n\nRequires MANAGE_BILLING permission (owner/admin). Currently exposes the\n``router_enabled`` toggle for the team's auto model-router.\n\nArgs:\n    team_id: Team UUID.\n    settings: Validated settings payload.\n    auth: Authenticated user context.\n\nReturns:\n    Success status with message.","operationId":"update_team_settings_teams__team_id__settings_patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Team Settings Teams  Team Id  Settings Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members/mfa-status":{"get":{"tags":["teams"],"summary":"Get Members Mfa Status","description":"Get MFA enrollment status for all team members.\n\nRequires MANAGE_BILLING permission (owner/admin).\n\nArgs:\n    team_id: Team UUID.\n    auth: Authenticated user context.\n\nReturns:\n    Members with their per-user ``has_mfa`` enrollment status.","operationId":"get_members_mfa_status_teams__team_id__members_mfa_status_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMembersMfaStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invitations/pending":{"get":{"tags":["team-invitations"],"summary":"Get Pending Invitations","description":"Get all pending invitations for the authenticated user.\n\nReturns invitations that match the user's email address and are not expired.\nUsed on login to show pending team invites.","operationId":"get_pending_invitations_invitations_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingInvitationsResponse"}}}}}}},"/invitations/{invitation_id}/accept":{"post":{"tags":["team-invitations"],"summary":"Accept Invitation","description":"Accept a team invitation.\n\nValidates the invitation belongs to the user's email.","operationId":"accept_invitation_invitations__invitation_id__accept_post","parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invitations/{invitation_id}/decline":{"post":{"tags":["team-invitations"],"summary":"Decline Invitation","description":"Decline a team invitation.","operationId":"decline_invitation_invitations__invitation_id__decline_post","parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages":{"post":{"tags":["anthropic-compat"],"summary":"Messages","description":"Anthropic-compatible messages endpoint.\n\nThin shell over :func:`services.inference.adapters.anthropic_messages.run_messages`.\nThe adapter handles content-block translation, LLM-passthrough vs\nPioneer-task dispatch, SSE rendering, persistence, and error\nmapping. The router keeps only HTTP-shaped concerns: route\ndeclaration, auth, rate limiting.\n\nArgs:\n    body: Validated :class:`AnthropicMessagesRequest`.\n    request: FastAPI request (forwarded so the adapter can read\n        API-key billing context out of ``request.state`` for\n        streaming responses).\n    auth: Authenticated request context.\n\nReturns:\n    :class:`AnthropicMessagesResponse` for non-streaming, or a\n    :class:`StreamingResponse` of Anthropic SSE events when\n    ``body.stream`` is true.","operationId":"messages_v1_messages_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessagesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"tags":["anthropic-compat"],"summary":"List Models","description":"List available Anthropic-compatible models.\n\nArgs:\n    limit: Maximum number of models to return. Omit to return the full\n        assembled catalog.\n    before_id: Cursor for paginating backward.\n    after_id: Cursor for paginating forward.\n    client_version: Optional Codex/OpenAI client version hint.\n    auth: Authentication result.\n\nReturns:\n    Combined Anthropic-compatible and Codex/OpenAI-compatible model catalog.\n\nRaises:\n    HTTPException: If both cursor parameters are provided.","operationId":"list_models_v1_models_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before Id"}},{"name":"after_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Id"}},{"name":"client_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models/{model_id}":{"get":{"tags":["anthropic-compat"],"summary":"Retrieve Model","description":"Retrieve metadata for a single Anthropic-compatible model.\n\nThe ``:path`` converter is required because our runtime catalog ships model\nIDs containing slashes (e.g. ``qwen/qwen3-8b``). Without it, FastAPI's default\nsingle-segment path param matcher 404s every such request — breaking\n``openai.OpenAI(...).models.retrieve(\"qwen/qwen3-8b\")`` and\n``anthropic.Anthropic(...).models.retrieve(\"qwen/qwen3-8b\")`` for real SDK\nusers.\n\nArgs:\n    model_id: Requested model identifier (may contain ``/``).\n    auth: Authentication result.\n\nReturns:\n    Combined Anthropic-compatible and Codex/OpenAI-compatible model metadata.\n\nRaises:\n    HTTPException: If the model ID is not in the runtime catalog.","operationId":"retrieve_model_v1_models__model_id__get","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint - publicly accessible without authentication.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[]}},"/version":{"get":{"summary":"Version","description":"Return backend version/build metadata for authenticated callers.","operationId":"version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/db_health":{"get":{"summary":"Db Health","description":"Health check endpoint with database status - publicly accessible without authentication.","operationId":"db_health_db_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[]}},"/":{"get":{"summary":"Root","description":"Root endpoint - API information - publicly accessible without authentication.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[]}}},"components":{"schemas":{"APIKeyInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"api_key_last_digits":{"type":"string","title":"Api Key Last Digits"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"usage_tokens":{"type":"integer","title":"Usage Tokens"},"usage_cost":{"type":"number","title":"Usage Cost"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["id","name","api_key_last_digits","created_at","usage_tokens","usage_cost","request_count"],"title":"APIKeyInfo","description":"Information about an API key."},"ActivityEvent":{"properties":{"id":{"type":"string","title":"Id","description":"Unique activity event identifier"},"type":{"type":"string","enum":["project","dataset","model","evaluation","deployment"],"title":"Type","description":"Activity event type"},"name":{"type":"string","title":"Name","description":"Human-readable activity name"},"action":{"type":"string","enum":["created","created_version","updated","deleted","deleted_version"],"title":"Action","description":"Action performed (created, updated, deleted, etc.)","default":"created"},"item_id":{"type":"string","title":"Item Id","description":"ID of the related item"},"created_by":{"type":"string","title":"Created By","description":"Display name of the creator"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the activity occurred"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID associated with the activity"}},"type":"object","required":["id","type","name","item_id","created_by","created_at"],"title":"ActivityEvent","description":"Represents a single user activity event."},"ActivityLogResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the request succeeded"},"events":{"items":{"$ref":"#/components/schemas/ActivityEvent"},"type":"array","title":"Events","description":"Activity events in reverse-chronological order"},"count":{"type":"integer","title":"Count","description":"Number of events returned"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more events are available beyond the current page","default":false}},"type":"object","required":["success","count"],"title":"ActivityLogResponse","description":"Response payload for activity log requests."},"AdapterTimeseriesEntry":{"properties":{"training_job":{"$ref":"#/components/schemas/TrainingJobResponse"},"latest_eval":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResponse"},{"type":"null"}]},"all_evals":{"items":{"$ref":"#/components/schemas/EvaluationResponse"},"type":"array","title":"All Evals"}},"type":"object","required":["training_job","all_evals"],"title":"AdapterTimeseriesEntry","description":"One training job together with all of its completed evaluations.\n\nAttributes:\n    training_job: Full training-job metadata.\n    latest_eval: Most-recent completed evaluation for this adapter.\n        None when the adapter has never been evaluated.\n    all_evals: Every evaluation (any status) associated with this adapter,\n        ordered by creation date descending."},"AdaptiveCadence":{"type":"string","enum":["off","daily","weekly","monthly"],"title":"AdaptiveCadence","description":"User-facing cadence preset for autonomous adaptive finetuning runs."},"AgentRunCallbackRequest":{"properties":{"status":{"type":"string","enum":["completed","failed"],"title":"Status"},"deliverables":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deliverables"},"data_curation_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Curation Report"},"final_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Report"},"system_deficiencies":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Deficiencies"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"llm_token_usage":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Llm Token Usage"}},"type":"object","required":["status"],"title":"AgentRunCallbackRequest","description":"Request payload for sandbox run-completion callbacks."},"AgentRunCallbackResponse":{"properties":{"agent_run_id":{"type":"string","title":"Agent Run Id"},"status":{"type":"string","title":"Status"},"accepted":{"type":"boolean","title":"Accepted"}},"type":"object","required":["agent_run_id","status","accepted"],"title":"AgentRunCallbackResponse","description":"Response payload for sandbox run-completion callbacks."},"AgentRunDetail":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"status":{"type":"string","title":"Status"},"trigger_type":{"type":"string","title":"Trigger Type"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","title":"Created At"},"report":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Report"},"data_curation_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Curation Report"},"final_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Report"},"system_deficiencies":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Deficiencies"},"sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Id"}},"type":"object","required":["id","project_id","status","trigger_type","created_at"],"title":"AgentRunDetail","description":"Full agent run details including deliverables."},"AgentRunListResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/AgentRunSummary"},"type":"array","title":"Runs","description":"List of agent runs."},"total":{"type":"integer","title":"Total","description":"Total count matching filters."},"limit":{"type":"integer","title":"Limit","description":"Page size limit."},"offset":{"type":"integer","title":"Offset","description":"Current offset."}},"type":"object","required":["runs","total","limit","offset"],"title":"AgentRunListResponse","description":"Paginated list of agent runs."},"AgentRunSummary":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"status":{"type":"string","title":"Status"},"trigger_type":{"type":"string","title":"Trigger Type"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","project_id","status","trigger_type","created_at"],"title":"AgentRunSummary","description":"Summary of a single agent run for list endpoints."},"AgentTurnBillingRequest":{"properties":{"turn_id":{"type":"string","maxLength":128,"minLength":1,"title":"Turn Id","description":"Sandbox-supplied dedup key for this turn (UUID recommended)."},"provider":{"type":"string","maxLength":64,"minLength":1,"title":"Provider"},"model":{"type":"string","maxLength":128,"minLength":1,"title":"Model"},"input_tokens":{"type":"integer","minimum":0.0,"title":"Input Tokens","default":0},"output_tokens":{"type":"integer","minimum":0.0,"title":"Output Tokens","default":0}},"type":"object","required":["turn_id","provider","model"],"title":"AgentTurnBillingRequest","description":"Per-turn LLM token usage report from an in-sandbox agent.\n\nCrash-safety design: sandboxes used to fan out a list of accumulated\n``(provider, model, input_tokens, output_tokens)`` rows from the\nend-of-run ``/complete`` callback, so a SIGKILL after N turns lost\nall N billing rows. Sandboxes now POST one of these requests per\nLLM turn so already-billed work is durable in the ``requests`` table\neven if the run subsequently dies.\n\nThe ``turn_id`` is generated client-side (typically the LangChain\ncallback's ``run_id`` UUID) and is the dedup key — replays of the\nsame ``(run_id, turn_id)`` are short-circuited and the cached\n``requests.id`` is returned."},"AgentTurnBillingResponse":{"properties":{"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id","description":"ID of the requests row created (or returned from dedup cache)."},"billed":{"type":"boolean","title":"Billed","description":"True when a new requests row was inserted; False when the call was deduped against an earlier turn."}},"type":"object","required":["billed"],"title":"AgentTurnBillingResponse","description":"Response from the per-turn billing endpoint.\n\n``billed`` is ``True`` when this call inserted a fresh ``requests``\nrow, and ``False`` when the dedup cache short-circuited a replay\n(``request_id`` then refers to the cached original row, not a new\nwrite). ``request_id`` is ``None`` when the underlying\n``BillableEvent.record`` failed to insert (degraded billing)."},"AnthropicMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ContentBlock"},{"$ref":"#/components/schemas/ImageContentBlock"},{"additionalProperties":true,"type":"object"}]},"type":"array"}],"title":"Content"}},"type":"object","required":["role","content"],"title":"AnthropicMessage","description":"A message in Anthropic format.\n\n``content`` accepts a plain string *or* a list of content blocks to support\nboth simple text and structured tool_use / tool_result payloads."},"AnthropicMessagesRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/AnthropicMessage"},"type":"array","minItems":1,"title":"Messages"},"max_tokens":{"type":"integer","maximum":131072.0,"minimum":1.0,"title":"Max Tokens","default":1024},"temperature":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Top P"},"stream":{"type":"boolean","title":"Stream","default":false},"store":{"type":"boolean","title":"Store","default":true},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/SystemContentBlock"},"type":"array"},{"type":"null"}],"title":"System"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"thinking":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Thinking","description":"Opt-in Anthropic-style extended-thinking controls. Pioneer does not enable thinking by default; send the Anthropic-native object: {'type': 'enabled', 'budget_tokens': N, 'display'?: 'summarized'|'omitted'} for manual mode, {'type': 'adaptive', 'effort'?: tier, 'display'?: ...} for adaptive mode (required on Opus 4.7+ / Mythos, recommended on Opus 4.6 / Sonnet 4.6), or {'type': 'disabled'} to turn thinking off on models that have it on by default. Pioneer canonicalizes this into InferenceRequest.reasoning at the adapter boundary so the request routes correctly whether the upstream is Anthropic native, Bedrock, or OpenRouter (which advertises the normalized ``reasoning`` field rather than ``thinking``). On models that require adaptive mode, Pioneer auto-upgrades manual configs (mapping ``budget_tokens`` to the nearest ``effort`` tier) rather than letting the upstream return a 400."},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema","description":"Schema for the Pioneer encoder. **Deprecated when supplied as a flat list** of entity labels; use the unified dict shape instead. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"**Deprecated.** Legacy task hint. The unified schema disambiguates the task automatically. Submitting this field emits ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"include_confidence":{"type":"boolean","title":"Include Confidence","default":true},"include_spans":{"type":"boolean","title":"Include Spans","default":true}},"type":"object","required":["model","messages"],"title":"AnthropicMessagesRequest","description":"Anthropic Messages API request format."},"AsyncGlinerRequest":{"properties":{"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"**Deprecated** legacy task hint. One of: 'extract_entities', 'classify_text', 'extract_json', 'schema'. Omit for the unified GLiNER2 path. Submitting a legacy task value still succeeds but the response carries ``Deprecation: true`` and a ``Sunset`` header."},"text":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Text"},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"}],"title":"Schema","description":"Extraction schema. The flat ``list[str]`` of entity labels is deprecated; use the unified dict shape (``entities`` / ``classifications`` / ``structures`` / ``relations``) for forward compatibility. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold","default":0.5},"include_confidence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Confidence","default":true},"include_spans":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Spans","default":true},"format_results":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Format Results","default":true}},"type":"object","required":["text","schema"],"title":"AsyncGlinerRequest","description":"Request for async GLiNER-2 processing."},"AsyncGlinerResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"estimated_tokens":{"type":"integer","title":"Estimated Tokens"},"message":{"type":"string","title":"Message"}},"type":"object","required":["job_id","status","estimated_tokens","message"],"title":"AsyncGlinerResponse","description":"Response from async job submission."},"AttachedResourceRef":{"properties":{"id":{"type":"string","title":"Id","description":"Type-prefixed resource id used by the frontend chip rendering. For example ``dataset:abc-123`` or ``model:tj-99``."},"name":{"type":"string","title":"Name","description":"Human-readable label rendered inside the chip."},"type":{"type":"string","title":"Type","description":"Resource type slug — one of ``dataset``, ``model``, ``evaluation``, or ``base-model``."}},"type":"object","required":["id","name","type"],"title":"AttachedResourceRef","description":"Pydantic mirror of the frontend ``AttachedResourceRef`` type.\n\nThe chip id carries a type prefix (``dataset:abc-123``) so the frontend\ncan render the correct icon without a second lookup. ``type`` repeats\nthe slug for clients that only consume one of the two fields."},"AugmentationOperation":{"properties":{"type":{"type":"string","enum":["remove_duplicates","remove_outliers","balance"],"title":"Type","description":"Type of augmentation operation"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this operation is enabled","default":true}},"type":"object","required":["type"],"title":"AugmentationOperation","description":"Configuration for a single augmentation operation."},"AutoAgentClarifyRequest":{"properties":{"message":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Message","description":"User text input (for new turns)"},"resume_value":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Resume Value","description":"MCQ option selected by user (resumes interrupted graph)"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Existing conversation ID"},"history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"History","description":"Conversation history [{role, content, tool_calls?, tool_call_id?, name?}]"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID selected by the user. Hidden from the chat UI and used to scope any resources created by a triggered Auto Agent run."},"client_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Client Metadata","description":"Optional client trace metadata for observability."}},"type":"object","title":"AutoAgentClarifyRequest","description":"Request body for a clarification agent turn.\n\nEither `message` (new turn) or `resume_value` (MCQ selection resume) must be set.\n\nArgs:\n    message: The user's text input for a new turn.\n    resume_value: The option the user selected from an MCQ (resumes interrupted graph).\n    conversation_id: Conversation ID (required for resume; generated on first call).\n    history: Optional conversation history [{role, content}]."},"AutoAgentRunListResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/AutoAgentRunSummary"},"type":"array","title":"Runs","description":"List of run summaries"},"count":{"type":"integer","title":"Count","description":"Number of runs returned","default":0}},"type":"object","title":"AutoAgentRunListResponse","description":"Response for listing Auto Agent runs.\n\nArgs:\n    runs: List of run summaries.\n    count: Number of runs in this response."},"AutoAgentRunRequest":{"properties":{"message":{"type":"string","maxLength":10000,"minLength":1,"title":"Message","description":"Task description for the Auto Agent"},"history":{"anyOf":[{"items":{"$ref":"#/components/schemas/MessageHistoryItem"},"type":"array"},{"type":"null"}],"title":"History","description":"Conversation history for multi-turn context"}},"type":"object","required":["message"],"title":"AutoAgentRunRequest","description":"Request body to start a new Auto Agent run.\n\nArgs:\n    message: The user's task description for the agent.\n    history: Optional conversation history for multi-turn context."},"AutoAgentRunResponse":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"UUID of the created run"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID grouping datasets and models from this run"},"results_url":{"type":"string","title":"Results Url","description":"URL to view results when run completes"}},"type":"object","required":["run_id","results_url"],"title":"AutoAgentRunResponse","description":"Response after creating a new Auto Agent run.\n\nArgs:\n    run_id: UUID of the created run.\n    project_id: Project grouping all datasets and models from this run.\n    results_url: Frontend URL to check results when the run completes."},"AutoAgentRunStatus":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"Run UUID"},"status":{"type":"string","title":"Status","description":"running | complete | failed | stopped"},"message":{"type":"string","title":"Message","description":"User task description","default":""},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID grouping datasets and models from this run"},"deliverables_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deliverables Json","description":"Parsed deliverables.json (available when complete)"},"curation_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Curation Report","description":"data-curation.md contents (available when complete)"},"final_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Report","description":"final_report.md contents (available when complete)"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error description (available when failed)"},"tool_calls_made":{"type":"integer","title":"Tool Calls Made","description":"Number of tool calls executed","default":0},"created_at":{"type":"string","title":"Created At","description":"ISO timestamp of run creation"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At","description":"ISO timestamp of completion"},"current_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Phase","description":"High-level progress phase: analyzing | researching | preparing_data | training | evaluating | finalizing"},"progress_updates":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Progress Updates","description":"Accumulating AI-generated progress summaries, each with summary and timestamp"}},"type":"object","required":["run_id","status","created_at"],"title":"AutoAgentRunStatus","description":"Current status and results of an Auto Agent run.\n\nArgs:\n    run_id: UUID of the run.\n    status: Current status (running | complete | failed).\n    message: The task description the user provided.\n    project_id: Project grouping all datasets and models from this run.\n    deliverables_json: Parsed deliverables.json when complete.\n    curation_report: Contents of data-curation.md when complete.\n    final_report: Contents of final_report.md when complete.\n    error_message: Error description when failed.\n    tool_calls_made: Number of tool calls the agent executed.\n    created_at: ISO timestamp when the run was created.\n    completed_at: ISO timestamp when the run completed, or None.\n    current_phase: High-level progress phase for the frontend stepper."},"AutoAgentRunSummary":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"Run UUID"},"status":{"type":"string","title":"Status","description":"running | complete | failed | stopped"},"message":{"type":"string","title":"Message","description":"User task description","default":""},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID for this run"},"tool_calls_made":{"type":"integer","title":"Tool Calls Made","description":"Number of tool calls executed","default":0},"created_at":{"type":"string","title":"Created At","description":"ISO timestamp of run creation"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At","description":"ISO timestamp of completion"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error description if failed"}},"type":"object","required":["run_id","status","created_at"],"title":"AutoAgentRunSummary","description":"Lightweight summary of an Auto Agent run for list views.\n\nArgs:\n    run_id: UUID of the run.\n    status: Current status (running | complete | failed).\n    message: The task description the user provided.\n    project_id: Project grouping all datasets and models from this run.\n    tool_calls_made: Number of tool calls the agent executed.\n    created_at: ISO timestamp when the run was created.\n    completed_at: ISO timestamp when the run completed, or None.\n    error_message: Error description when failed."},"BaseModelResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Model ID (canonical routing key)"},"label":{"type":"string","title":"Label","description":"Human-friendly display name"},"description":{"type":"string","title":"Description","description":"Short description shown in UI"},"task_type":{"type":"string","title":"Task Type","description":"Model architecture: 'decoder' for LLMs, 'encoder' for GLiNER/NER models"},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window","description":"Maximum context length in tokens (min across providers)"},"input_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Price Per Million","description":"Upper-bound USD list price per million input tokens (highest provider COGS multiplied by the inference margin). Caps what BillableEvent.record can charge for model_inference; actual charges may be lower when the request is routed to a cheaper provider."},"output_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Output Price Per Million","description":"Upper-bound USD list price per million output tokens (highest provider COGS multiplied by the inference margin). Caps what BillableEvent.record can charge for model_inference; actual charges may be lower when the request is routed to a cheaper provider."},"cache_read_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Read Price Per Million","description":"Effective upper-bound USD list price per million input tokens served from the provider's prompt cache (Anthropic cache_read_input_tokens, Bedrock cacheReadInputTokens, OpenAI / Fireworks prompt_tokens_details.cached_tokens). Always the rate BillableEvent.record actually charges: when a provider does not differentiate cache-read pricing this equals ``input_price_per_million`` rather than ``None``, so customers compute ``cache_read_tokens × cache_read_price`` without special-casing. ``None`` only when the model has no pricing at all (cache reads are still tracked for analytics)."},"cache_write_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Write Price Per Million","description":"Effective upper-bound USD list price per million input tokens written into the provider's prompt cache (Anthropic cache_creation_input_tokens, Bedrock cacheWriteInputTokens). Providers that charge cache writes at the plain input rate (OpenAI, Modal) report ``input_price_per_million`` here rather than ``None``, matching what BillableEvent.record charges. ``None`` only when the model has no pricing at all."},"supports_inference":{"type":"boolean","title":"Supports Inference","description":"Whether this model supports serverless base-model inference (pre-deployed, no startup latency, pay-per-token)."},"is_chat_model":{"type":"boolean","title":"Is Chat Model","description":"Whether the model has a chat template suitable for /v1/chat/completions. Pretrained/base models lack a chat template and produce gibberish on chat-formatted messages; frontends should route them to /v1/completions instead."},"supports_on_demand_inference":{"type":"boolean","title":"Supports On Demand Inference","description":"Whether this model supports on-demand LoRA deployment (dedicated GPU serving a fine-tuned adapter)."},"supports_training":{"type":"boolean","title":"Supports Training","description":"Whether this model supports fine-tuning on any provider. When False the model is available for inference only."},"license":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License","description":"SPDX license identifier or short name for the model weights (e.g. 'Apache-2.0', 'Llama-3-Community', 'Proprietary'). Display string only — null when unknown."},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier","description":"Capability tier: 'open' (open weights), 'fast' (latency-optimized), 'enterprise' (proprietary commercial API), or 'research' (research preview). Null when unclassified."},"deprecated":{"type":"boolean","title":"Deprecated","description":"Whether the model is deprecated and discouraged for new work. Deprecated models still serve requests until their sunset date; sunset (removed) models are omitted from this catalog entirely.","default":false},"replacement_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replacement Model","description":"Canonical ID of the successor model to migrate to, when the model is deprecated and a replacement is declared."},"deprecation_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Deprecation Date","description":"Date the model entered (or will enter) the deprecated state. Null when the model is not on a deprecation path."},"sunset_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Sunset Date","description":"Date the model is removed and requests begin to be rejected. Null when no removal is scheduled."}},"type":"object","required":["id","label","description","task_type","supports_inference","is_chat_model","supports_on_demand_inference","supports_training"],"title":"BaseModelResponse","description":"Display metadata for a single base model in the public catalog."},"BaseModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/BaseModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"BaseModelsResponse","description":"Response listing all base models in the public catalog."},"BenchmarkEvaluationRequest":{"properties":{"model_id":{"type":"string","title":"Model Id","description":"Training job ID, explicit GLiNER base model ID ('fastino/gliner2-base-v1'), or decoder base model ID ('base:{hf_model_id}')"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID to associate the benchmark evaluation with"},"task":{"type":"string","enum":["ner","text_classification"],"title":"Task","description":"Task type for evaluation"},"benchmark":{"type":"string","title":"Benchmark","description":"Benchmark name (e.g., 'fewnerd', 'mteb/banking77', 'tweeteval')"},"max_samples":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Max Samples","description":"Maximum samples to evaluate","default":100},"split":{"type":"string","title":"Split","description":"Dataset split to use","default":"test"},"benchmark_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Benchmark Config","description":"Additional benchmark-specific configuration"}},"type":"object","required":["model_id","task","benchmark"],"title":"BenchmarkEvaluationRequest","description":"Request to run a benchmark evaluation"},"BenchmarkEvaluationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"evaluation_id":{"type":"string","title":"Evaluation Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"status":{"type":"string","enum":["pending","running","complete","failed","cancelled"],"title":"Status"},"task":{"type":"string","title":"Task"},"benchmark":{"type":"string","title":"Benchmark"},"model_id":{"type":"string","title":"Model Id"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"additionalProperties":true,"type":"object","required":["success","evaluation_id","status","task","benchmark","model_id","created_at"],"title":"BenchmarkEvaluationResponse","description":"Response for benchmark evaluation"},"BenchmarkInfo":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"task":{"type":"string","title":"Task"},"dataset_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Source"},"metrics":{"items":{"type":"string"},"type":"array","title":"Metrics","default":[]}},"type":"object","required":["name","description","task"],"title":"BenchmarkInfo","description":"Information about a benchmark"},"BillingPortalResponse":{"properties":{"url":{"type":"string","title":"Url","description":"Stripe Billing Portal session URL"}},"type":"object","required":["url"],"title":"BillingPortalResponse","description":"Response containing a Stripe Billing Portal URL."},"BillingStatusResponse":{"properties":{"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"total_usage":{"type":"number","title":"Total Usage"},"free_tier_remaining":{"type":"number","title":"Free Tier Remaining"},"exceeds_free_tier":{"type":"boolean","title":"Exceeds Free Tier"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"},"card_verified":{"type":"boolean","title":"Card Verified","default":false},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"payment_methods":{"items":{"$ref":"#/components/schemas/PaymentMethodInfo"},"type":"array","title":"Payment Methods"},"payment_plan":{"type":"string","title":"Payment Plan","default":"hobby"},"credit_limit":{"type":"number","title":"Credit Limit"}},"type":"object","required":["total_usage","free_tier_remaining","exceeds_free_tier","has_payment_method","credit_limit"],"title":"BillingStatusResponse","description":"Response model for billing status."},"Body_create_dataset_version_felix_datasets__name__post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Dataset file (JSONL, CSV, or Parquet)"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format","description":"File format (jsonl, csv, parquet). Auto-detected if not provided."}},"type":"object","required":["file"],"title":"Body_create_dataset_version_felix_datasets__name__post"},"Body_upload_user_report_attachments_user_reports_attachments_post":{"properties":{"report_id":{"type":"string","title":"Report Id","description":"Backend-generated report UUID."},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Files to attach to the report."}},"type":"object","required":["report_id","files"],"title":"Body_upload_user_report_attachments_user_reports_attachments_post"},"CancelBenchmarkResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"CancelBenchmarkResponse","description":"Response model for canceling a benchmark evaluation"},"CancellationFeedbackRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Selected cancellation reason (e.g. 'Pricing', 'Missing features')"},"feedback_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Text","description":"Optional free-text feedback from the user"}},"type":"object","title":"CancellationFeedbackRequest","description":"Optional feedback submitted during the offboarding flow.\n\nSent with both the downgrade and account cancellation endpoints\nso the cancellation reason can be tracked in analytics."},"ChatCompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","default":0},"message":{"additionalProperties":true,"type":"object","title":"Message"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"}},"type":"object","title":"ChatCompletionChoice","description":"A single completion choice."},"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/schemas__openai_compat__ChatMessage"},"type":"array","minItems":1,"title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"System"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"max_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens"},"response_format":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Response Format"},"stop":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"title":"Stop"},"stream":{"type":"boolean","title":"Stream","default":false},"extra_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Extra Headers"},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body"},"reasoning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Reasoning","description":"Opt-in reasoning / extended-thinking controls. Accepts the OpenRouter-normalized shape with keys ``enabled`` (bool), ``max_tokens`` (int, Anthropic-style budget), ``effort`` (one of minimal/low/medium/high/xhigh/none, OpenAI/Grok-style tier), and ``exclude`` (bool, hide reasoning tokens from the response). ``effort`` and ``max_tokens`` are mutually exclusive. Pioneer extensions for Claude routes (Anthropic direct + Bedrock): ``mode`` (manual/adaptive — adaptive lets the model pick thinking depth per request, required on Opus 4.7+) and ``display`` (summarized/omitted — controls whether thinking text streams back; omitted preserves only the signature for multi-turn). Pioneer canonicalizes this into InferenceRequest.reasoning at the adapter boundary and each provider renders it to its native wire field (Anthropic ``thinking``, OpenAI ``reasoning_effort``, OpenRouter ``reasoning``). Pioneer does not enable reasoning by default."},"store":{"type":"boolean","title":"Store","default":true},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N"},"presence_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Presence Penalty"},"frequency_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Frequency Penalty"},"logit_bias":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Logit Bias"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"tools":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema","description":"Schema for the Pioneer encoder. **Deprecated when supplied as a flat list** of entity labels; use the unified dict shape (``entities`` / ``classifications`` / ``structures`` / ``relations``) instead. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"**Deprecated.** Legacy task hint (``extract_entities`` / ``classify_text`` / ``extract_json`` / ``ner`` / ``schema``). The unified schema disambiguates the task automatically so this field is no longer required. Submitting it emits ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers on the response."},"include_confidence":{"type":"boolean","title":"Include Confidence","default":true},"include_spans":{"type":"boolean","title":"Include Spans","default":true}},"type":"object","required":["model","messages"],"title":"ChatCompletionRequest","description":"OpenAI-compatible chat completion request."},"ChatCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"chat.completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionChoice"},"type":"array","title":"Choices"},"usage":{"$ref":"#/components/schemas/ChatCompletionUsage"},"x_pioneer":{"anyOf":[{"$ref":"#/components/schemas/PioneerExtension"},{"type":"null"}]}},"type":"object","required":["model","choices","usage"],"title":"ChatCompletionResponse","description":"OpenAI-compatible chat completion response."},"ChatCompletionUsage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","default":0},"prompt_tokens_details":{"anyOf":[{"$ref":"#/components/schemas/PromptTokensDetails"},{"type":"null"}]}},"type":"object","title":"ChatCompletionUsage","description":"Token usage statistics.\n\n``prompt_tokens`` follows the upstream wire contract — *includes* every\ninput class (non-cached, cache read, and cache write). The breakdown is\nexposed under ``prompt_tokens_details`` so consumers can attribute the\ncached-read and cache-write subsets. Cache-aware billing on the brain\nside reads the canonical ``InferenceUsage`` fields directly, not this\nwire payload."},"ChatMessageCreate":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user', 'assistant', or 'tool'"},"content":{"type":"string","title":"Content","description":"Message content"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id","description":"Tool call ID for tool messages"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls made by assistant"}},"type":"object","required":["role","content"],"title":"ChatMessageCreate","description":"Schema for a single chat message."},"ChatMessageResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"images":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Images"},"message_index":{"type":"integer","title":"Message Index"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","session_id","role","content","message_index","created_at"],"title":"ChatMessageResponse","description":"Response model for a single chat message."},"ChatSessionCreate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Title","description":"Session title (auto-generated if not provided)"},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message","description":"First user message (used for auto-title generation)"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID to scope the session to"}},"type":"object","title":"ChatSessionCreate","description":"Request model for creating a chat session."},"ChatSessionDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["success","message","session_id"],"title":"ChatSessionDeleteResponse","description":"Response model for deleting a session."},"ChatSessionListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"sessions":{"items":{"$ref":"#/components/schemas/ChatSessionResponse"},"type":"array","title":"Sessions"},"count":{"type":"integer","title":"Count"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["sessions","count","total"],"title":"ChatSessionListResponse","description":"Response model for listing chat sessions."},"ChatSessionMessagesAppend":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessageCreate"},"type":"array","minItems":1,"title":"Messages","description":"Messages to append"}},"type":"object","required":["messages"],"title":"ChatSessionMessagesAppend","description":"Request model for appending messages to a session."},"ChatSessionMessagesAppendResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"session_id":{"type":"string","title":"Session Id"},"messages_added":{"type":"integer","title":"Messages Added"}},"type":"object","required":["session_id","messages_added"],"title":"ChatSessionMessagesAppendResponse","description":"Response model for appending messages."},"ChatSessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"modal_sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Sandbox Id","description":"Modal sandbox id for the persistent MLE agent runtime, if a sandbox is associated with this session. Surfaced for nightly smoke tests and observability — never used for client routing."},"first_user_attached_resources":{"items":{"$ref":"#/components/schemas/AttachedResourceRef"},"type":"array","title":"First User Attached Resources","description":"Resource chips the user attached to the *first* user message of this session, parsed from its attached-context preamble. Powers the threads-sidebar preview so users can see at a glance what context a thread was anchored on without opening it. Empty when the session has no user messages or none of them carry a preamble."}},"type":"object","required":["id","user_id","title","created_at","updated_at"],"title":"ChatSessionResponse","description":"Response model for a chat session (without messages)."},"ChatSessionUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Title","description":"New title for the session"},"is_archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Archived","description":"Archive status of the session"}},"type":"object","title":"ChatSessionUpdate","description":"Request model for updating a chat session."},"ChatSessionWithMessages":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"modal_sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Sandbox Id","description":"Modal sandbox id for the persistent MLE agent runtime, if a sandbox is associated with this session."},"raw_message_tree_present":{"type":"boolean","title":"Raw Message Tree Present","description":"True when the sandbox runtime has persisted a canonical Anthropic message tree for this session. The tree itself is backend-only state (it includes provider request payloads) so we expose only a presence flag that nightly smoke tests can assert on.","default":false},"first_user_attached_resources":{"items":{"$ref":"#/components/schemas/AttachedResourceRef"},"type":"array","title":"First User Attached Resources","description":"Resource chips the user attached to the *first* user message of this session, parsed from its attached-context preamble. Mirrors the same field on :class:`ChatSessionResponse` so the agent page header can render the chips next to the session title without scanning every message in ``messages``."},"messages":{"items":{"$ref":"#/components/schemas/ChatMessageResponse"},"type":"array","title":"Messages"}},"type":"object","required":["id","user_id","title","created_at","updated_at","messages"],"title":"ChatSessionWithMessages","description":"Response model for a chat session with all messages."},"CheckoutSessionStatusResponse":{"properties":{"paid":{"type":"boolean","title":"Paid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Stripe session status (e.g. 'complete', 'open', 'expired')"},"payment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Status","description":"Stripe payment status (e.g. 'paid', 'unpaid', 'no_payment_required')"}},"type":"object","required":["paid"],"title":"CheckoutSessionStatusResponse","description":"Verified status of a Stripe checkout session.\n\nReturned from ``GET /billing/checkout-session-status`` so the\nunauthenticated success page can confirm that the session_id\ncorresponds to a paid session before rendering the confirmation."},"CheckpointListResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"checkpoints":{"items":{"$ref":"#/components/schemas/CheckpointResponse"},"type":"array","title":"Checkpoints"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","checkpoints","count"],"title":"CheckpointListResponse","description":"List of checkpoints response"},"CheckpointResponse":{"properties":{"id":{"type":"string","title":"Id"},"job_id":{"type":"string","title":"Job Id"},"epoch":{"type":"integer","title":"Epoch"},"step":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step"},"training_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Training Loss"},"validation_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Validation Loss"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"learning_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Learning Rate"},"gpu_memory_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gpu Memory Used"},"gpu_memory_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gpu Memory Total"},"checkpoint_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Path"},"is_deployable":{"type":"boolean","title":"Is Deployable","default":false},"is_best":{"type":"boolean","title":"Is Best","default":false},"is_final":{"type":"boolean","title":"Is Final","default":false},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","job_id","epoch","created_at","updated_at"],"title":"CheckpointResponse","description":"Single checkpoint response"},"ClassBalance":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["label","count"],"title":"ClassBalance"},"ClassifiedExample":{"properties":{"text":{"type":"string","title":"Text","description":"Example text"},"label":{"type":"string","title":"Label","description":"Example label"},"feedback":{"anyOf":[{"type":"string","enum":["positive","negative"]},{"type":"null"}],"title":"Feedback","description":"User feedback: positive (upvote) or negative (downvote)"}},"type":"object","required":["text","label"],"title":"ClassifiedExample","description":"Example with optional user feedback for improving generation."},"CliTelemetryEvent":{"properties":{"event":{"type":"string","title":"Event"},"installation_id":{"type":"string","title":"Installation Id"},"cli_version":{"type":"string","title":"Cli Version"},"os_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Type"},"os_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Platform"},"os_arch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Arch"}},"additionalProperties":true,"type":"object","required":["event","installation_id","cli_version"],"title":"CliTelemetryEvent","description":"CLI telemetry event payload."},"CompetitionInfo":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_type":{"type":"string","title":"Dataset Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the competition task"},"sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Count"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"sample_rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Sample Rows","description":"Preview of a few sample rows from the dataset"},"winner":{"anyOf":[{"$ref":"#/components/schemas/LeaderboardEntry"},{"type":"null"}]},"total_entries":{"type":"integer","title":"Total Entries","default":0}},"type":"object","required":["dataset_id","dataset_name","dataset_type"],"title":"CompetitionInfo","description":"Information about a competition dataset."},"CompetitionsResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"competitions":{"items":{"$ref":"#/components/schemas/CompetitionInfo"},"type":"array","title":"Competitions"}},"type":"object","required":["competitions"],"title":"CompetitionsResponse","description":"Response listing all active competitions."},"ConstraintRequest":{"properties":{"description":{"type":"string","title":"Description","description":"Constraint description"},"choices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Choices","description":"Optional list of choices for this constraint"},"weights":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Weights","description":"Optional weights for choices (must align with choices length)"},"probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Probability","description":"Optional probability (0.0-1.0) for this constraint"}},"type":"object","required":["description"],"title":"ConstraintRequest","description":"Constraint request model"},"ContentBlock":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input"},"tool_use_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Use Id"},"content":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"type":"null"}],"title":"Content"}},"additionalProperties":true,"type":"object","title":"ContentBlock","description":"A content block in Anthropic format.\n\nSupports ``text``, ``tool_use``, and ``tool_result`` block types so that\ntool-calling round-trips work with Anthropic SDK clients."},"CreateAPIKeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Name for the API key"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"Optional expiration timestamp (ISO 8601). Sentinel strings like 'never' are accepted and treated as no expiration."},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id","description":"Team to bind the key to. Defaults to the caller's active team when omitted; an explicit value must equal the active team."},"captcha_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captcha Token","description":"hCaptcha response token for bot verification"}},"type":"object","required":["name"],"title":"CreateAPIKeyRequest","description":"Request model for creating an API key.\n\nAttributes:\n    name: User-visible identifier for the key.\n    expires_at: Optional ISO-8601 expiry; sentinels (``\"\"``, ``never``,\n        ``none``, ``null``) collapse to ``None``.\n    team_id: Tenant the key is bound to. ``None`` defaults to the\n        caller's active team; an explicit value must equal it.\n    captcha_token: hCaptcha response token for bot verification."},"CreateAPIKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"api_key_last_digits":{"type":"string","title":"Api Key Last Digits"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"team_id":{"type":"string","title":"Team Id"},"secret_key":{"type":"string","title":"Secret Key"},"stripe_customer_created":{"type":"boolean","title":"Stripe Customer Created","default":false}},"type":"object","required":["id","name","api_key_last_digits","created_at","team_id","secret_key"],"title":"CreateAPIKeyResponse","description":"Response model for API key creation."},"CustomEnumCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Name for the enum type"},"values":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Values","description":"List of allowed enum values"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Optional description of the enum"}},"type":"object","required":["name","values"],"title":"CustomEnumCreate","description":"Request model for creating a custom enum."},"CustomEnumDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"enum_id":{"type":"string","title":"Enum Id"}},"type":"object","required":["success","message","enum_id"],"title":"CustomEnumDeleteResponse","description":"Response model for deleting a custom enum."},"CustomEnumListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"enums":{"items":{"$ref":"#/components/schemas/CustomEnumResponse"},"type":"array","title":"Enums"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["enums","count"],"title":"CustomEnumListResponse","description":"Response model for listing custom enums."},"CustomEnumResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"values":{"items":{"type":"string"},"type":"array","title":"Values"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","user_id","name","values","created_at","updated_at"],"title":"CustomEnumResponse","description":"Response model for a single custom enum."},"CustomEnumUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"New name for the enum"},"values":{"anyOf":[{"items":{"type":"string"},"type":"array","minItems":1},{"type":"null"}],"title":"Values","description":"New list of allowed values"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"New description"}},"type":"object","title":"CustomEnumUpdate","description":"Request model for updating a custom enum."},"DataEditingCheckLabelsRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Dataset name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Dataset version (latest if omitted)"},"text_column":{"type":"string","title":"Text Column","description":"Column containing text"},"label_column":{"type":"string","title":"Label Column","description":"Column containing labels"},"sample_size":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Sample Size","description":"Number of samples to check","default":10}},"type":"object","required":["dataset_name","text_column","label_column"],"title":"DataEditingCheckLabelsRequest","description":"Request to check labels using AI"},"DataEditingCheckLabelsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"checked_count":{"type":"integer","title":"Checked Count"},"issues_found":{"type":"integer","title":"Issues Found"},"results":{"items":{"$ref":"#/components/schemas/LabelCheckResult"},"type":"array","title":"Results"}},"type":"object","required":["success","dataset_name","dataset_version","checked_count","issues_found","results"],"title":"DataEditingCheckLabelsResponse","description":"Response from label checking"},"DataEditingRemoveRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Dataset name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Dataset version (latest if omitted)"},"findings":{"items":{"$ref":"#/components/schemas/PIIFinding"},"type":"array","title":"Findings","description":"Findings to redact/remove"},"redaction_method":{"type":"string","enum":["redact","remove_row","mask"],"title":"Redaction Method","description":"How to handle findings","default":"redact"},"new_dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Dataset Name","description":"Name for the cleaned dataset (auto-generated if omitted)"}},"type":"object","required":["dataset_name","findings"],"title":"DataEditingRemoveRequest","description":"Request to remove PII/PHD from dataset"},"DataEditingRemoveResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"new_dataset_name":{"type":"string","title":"New Dataset Name"},"new_dataset_version":{"type":"string","title":"New Dataset Version"},"rows_affected":{"type":"integer","title":"Rows Affected"},"entities_removed":{"type":"integer","title":"Entities Removed"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","dataset_name","dataset_version","new_dataset_name","new_dataset_version","rows_affected","entities_removed","message"],"title":"DataEditingRemoveResponse","description":"Response after removing PII/PHD"},"DataEditingScanRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Dataset name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Version number (latest if omitted)"},"columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Columns","description":"Columns to scan. If not specified, scans all string columns."},"threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Threshold","description":"Detection threshold","default":0.5}},"type":"object","required":["dataset_name"],"title":"DataEditingScanRequest","description":"Request to scan dataset for PII or PHD"},"DataEditingScanResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"scan_type":{"type":"string","enum":["pii","phd"],"title":"Scan Type"},"findings_count":{"type":"integer","title":"Findings Count"},"affected_rows":{"type":"integer","title":"Affected Rows"},"findings":{"items":{"$ref":"#/components/schemas/PIIFinding"},"type":"array","title":"Findings"}},"type":"object","required":["success","dataset_name","dataset_version","scan_type","findings_count","affected_rows","findings"],"title":"DataEditingScanResponse","description":"Response from PII/PHD scanning"},"DataEditingSubsampleRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Dataset name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Dataset version (latest if omitted)"},"method":{"type":"string","enum":["random","balanced","stratified"],"title":"Method","description":"Subsampling method","default":"random"},"n":{"type":"integer","minimum":1.0,"title":"N","description":"Target number of samples"},"label_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Column","description":"Column for balanced/stratified sampling"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for reproducibility"},"new_dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Dataset Name","description":"Name for the new subsampled dataset (auto-generated if omitted)"}},"type":"object","required":["dataset_name","n"],"title":"DataEditingSubsampleRequest","description":"Request to subsample a dataset"},"DataEditingSubsampleResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"new_dataset_name":{"type":"string","title":"New Dataset Name"},"new_dataset_version":{"type":"string","title":"New Dataset Version"},"original_rows":{"type":"integer","title":"Original Rows"},"new_rows":{"type":"integer","title":"New Rows"},"method":{"type":"string","title":"Method"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","dataset_name","dataset_version","new_dataset_name","new_dataset_version","original_rows","new_rows","method","message"],"title":"DataEditingSubsampleResponse","description":"Response after subsampling"},"DatasetAnalysisRequest":{"properties":{"task_type":{"type":"string","enum":["ner","classification","generative"],"title":"Task Type","description":"Task type of the dataset"},"task_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Description","description":"Description of the task/domain for context. Helps the LLM quality analysis understand the intended use case."},"dataset":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Dataset","description":"List of data samples (optional if dataset_name provided)"},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name of stored dataset to analyze (optional if dataset provided)"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version","description":"Dataset version (latest if omitted)"},"analyses":{"items":{"type":"string","enum":["distribution","duplicates","outliers","correlation","splits","errors","diversity"]},"type":"array","title":"Analyses","description":"List of analyses to perform"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"Natural language question about the dataset"},"predictions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Predictions","description":"Optional model predictions for error analysis"},"options":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Options","description":"Configuration options for analysis. Supported keys: `validation_percentage` (float) for split analysis and `diversity_visualization` (object) with optional `method` ('pca'|'tsne'|'umap'), `dimensions` (2-4), and `tsne_perplexity` (float)."}},"type":"object","required":["task_type","analyses"],"title":"DatasetAnalysisRequest","description":"Request for dataset analysis","example":{"analyses":["distribution","outliers","duplicates","diversity"],"dataset":[{"entities":[["Apple","ORG"],["U.K.","GPE"],["$1 billion","MONEY"]],"text":"Apple is looking at buying U.K. startup for $1 billion"},{"entities":[["San Francisco","GPE"]],"text":"San Francisco considers banning sidewalk delivery robots"}],"options":{"diversity_visualization":{"dimensions":3,"method":"tsne","tsne_perplexity":25}},"query":"What is the distribution of entity types?","task_type":"ner"}},"DatasetAnalysisResponse":{"properties":{"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"distribution":{"anyOf":[{"$ref":"#/components/schemas/DistributionAnalysis"},{"type":"null"}]},"duplicates":{"anyOf":[{"$ref":"#/components/schemas/DuplicatesAnalysis"},{"type":"null"}]},"outliers":{"anyOf":[{"$ref":"#/components/schemas/OutliersAnalysis"},{"type":"null"}]},"correlations":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Correlations"},"splits":{"anyOf":[{"$ref":"#/components/schemas/SplitsAnalysis"},{"type":"null"}]},"errors":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Errors"},"diversity":{"anyOf":[{"$ref":"#/components/schemas/DiversityAnalysis"},{"type":"null"}]},"natural_language_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Natural Language Response"}},"type":"object","required":["summary"],"title":"DatasetAnalysisResponse","description":"Response containing analysis results"},"DatasetAugmentationRequest":{"properties":{"task_type":{"type":"string","enum":["ner","classification","custom"],"title":"Task Type","description":"Task type of the dataset"},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name of stored dataset to augment"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version","description":"Dataset version (latest if omitted)"},"dataset":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Dataset","description":"Inline dataset to augment (if dataset_name not provided)"},"operations":{"items":{"$ref":"#/components/schemas/AugmentationOperation"},"type":"array","title":"Operations","description":"List of augmentation operations to perform"},"target_distribution":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Target Distribution","description":"Target class/entity distribution as percentages (must sum to 1.0)"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for synthetic sample generation"},"new_dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Dataset Name","description":"Name for the new augmented dataset (required if update_in_place=False)"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Labels for generation (required if balance operation used)"},"update_in_place":{"type":"boolean","title":"Update In Place","description":"If True, creates new version with same name and soft-deletes old version","default":false}},"type":"object","required":["task_type","operations"],"title":"DatasetAugmentationRequest","description":"Request for dataset augmentation.","example":{"dataset_name":"my-reviews-dataset","domain_description":"Customer reviews for e-commerce products","labels":["positive","negative"],"new_dataset_name":"balanced_reviews_v2","operations":[{"enabled":true,"type":"remove_duplicates"},{"enabled":true,"type":"remove_outliers"},{"enabled":true,"type":"balance"}],"target_distribution":{"negative":0.5,"positive":0.5},"task_type":"classification","update_in_place":false}},"DatasetAugmentationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"original_dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Dataset Name"},"original_dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Dataset Version"},"new_dataset":{"$ref":"#/components/schemas/DatasetResponse"},"modifications":{"$ref":"#/components/schemas/ModificationSummary"},"distribution_comparison":{"items":{"$ref":"#/components/schemas/DistributionComparison"},"type":"array","title":"Distribution Comparison"},"message":{"type":"string","title":"Message"},"updated_in_place":{"type":"boolean","title":"Updated In Place","description":"True if the original dataset was replaced (soft-deleted)","default":false}},"type":"object","required":["success","new_dataset","modifications","distribution_comparison","message"],"title":"DatasetAugmentationResponse","description":"Response containing augmentation results."},"DatasetEvaluationSummary":{"properties":{"evaluation_id":{"type":"string","title":"Evaluation Id"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"f1_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"F1 Score"},"sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Count"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["evaluation_id"],"title":"DatasetEvaluationSummary","description":"Latest evaluation attached to an evaluation dataset row.\n\nUsed on the Datasets tab to surface the most recent pass-rate / loss\nfor a given evaluation dataset against the model in context."},"DatasetEvaluationsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"sample_count":{"type":"integer","title":"Sample Count"},"models":{"items":{"$ref":"#/components/schemas/ModelWithEvaluation"},"type":"array","title":"Models"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","dataset_name","dataset_version","sample_count","models","count"],"title":"DatasetEvaluationsResponse","description":"Response for all evaluations on a dataset"},"DatasetLLMAnalysisRequest":{"properties":{"task_type":{"type":"string","enum":["ner","classification","generative"],"title":"Task Type","description":"Task type of the dataset"},"task_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Description","description":"Description of the task/domain for context. Helps the LLM understand the intended use case."},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"List of label names for the task. If not provided, will be extracted from the dataset."},"dataset":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Dataset","description":"List of data samples (optional if dataset_name provided)"},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name of stored dataset to analyze (optional if dataset provided)"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version","description":"Dataset version (latest if omitted)"}},"type":"object","required":["task_type"],"title":"DatasetLLMAnalysisRequest","description":"Request for LLM-only dataset quality analysis.\n\nUse this endpoint for the slow LLM-based diversity/quality analysis\nseparately from the fast statistical analysis endpoint.","example":{"dataset_name":"my-ner-dataset","labels":["ORG","LOC","PERSON"],"task_description":"Extract company names and locations from news articles","task_type":"ner"}},"DatasetListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"datasets":{"items":{"$ref":"#/components/schemas/DatasetResponse"},"type":"array","title":"Datasets"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["datasets","count"],"title":"DatasetListResponse","description":"Response model for listing datasets."},"DatasetMergeRequest":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/DatasetMergeSource"},"type":"array","minItems":2,"title":"Sources","description":"Datasets to merge (at least 2)"},"output_name":{"type":"string","title":"Output Name","description":"Name for the merged dataset"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project to assign the merged dataset to"}},"type":"object","required":["sources","output_name"],"title":"DatasetMergeRequest","description":"Request to merge multiple datasets into one."},"DatasetMergeResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"version":{"type":"string","title":"Version"},"sample_size":{"type":"integer","title":"Sample Size","description":"Total rows in the merged dataset"},"source_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Source Counts","description":"Number of rows contributed by each source dataset"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","dataset_name","version","sample_size","source_counts","message"],"title":"DatasetMergeResponse","description":"Response from a merge operation."},"DatasetMergeSource":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Name of the dataset"},"version":{"type":"string","title":"Version","description":"Version to merge (default: latest)","default":"latest"}},"type":"object","required":["dataset_name"],"title":"DatasetMergeSource","description":"A dataset to include in a merge operation."},"DatasetMetadataUpdate":{"properties":{"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"New name for the dataset"},"dataset_type":{"anyOf":[{"type":"string","enum":["ner","classification","custom","decoder"]},{"type":"null"}],"title":"Dataset Type","description":"New type for the dataset"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID to assign this dataset to (use empty string to unassign)."}},"type":"object","title":"DatasetMetadataUpdate","description":"Request model for the legacy ``PUT /felix/datasets/{name}/{version}`` endpoint.\n\nConvention divergence: this legacy endpoint accepts ``project_id=\"\"``\n(empty string) to mean \"unassign\". The newer canonical endpoint\n``PATCH /felix/datasets/{dataset_id}`` (see :class:`DatasetUpdate`) uses\n``project_id=null`` for the same intent. Both schemas coexist because\n``frontend/src/app/utils/assign-project-handler.ts`` still drives the\nlegacy PUT path with ``projectId || ''``. New callers should prefer the\nPATCH endpoint and the ``null`` convention."},"DatasetQueryRequest":{"properties":{"dataset_name":{"type":"string","maxLength":255,"pattern":"^[A-Za-z0-9_\\-./]+$","title":"Dataset Name","description":"Name of the dataset to query"},"version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Version","description":"Dataset version (latest if omitted)"},"code":{"type":"string","maxLength":4096,"title":"Code","description":"Polars code to execute. Access data as 'df'. Assign output to 'result'."},"timeout":{"type":"integer","maximum":120.0,"minimum":1.0,"title":"Timeout","description":"Execution timeout in seconds (1-120)","default":30},"max_rows_returned":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Max Rows Returned","description":"Maximum rows to return in result (1-100000)","default":10000}},"type":"object","required":["dataset_name","code"],"title":"DatasetQueryRequest","description":"Request to execute Polars code on a dataset server-side.\n\nThe code has access to:\n- `df`: Polars DataFrame containing the dataset\n- `pl`: Polars module for expressions (pl.col, pl.lit, pl.when, etc.)\n\nAssign result to `result` variable to return it.\nMulti-statement code with intermediate variables is supported.\nControl-flow (for/while/if-stmt), comprehensions, and f-strings are\nnot available; use ternary expressions (A if cond else B) for\nconditional results.","examples":[{"code":"result = df.group_by('label').count()","dataset_name":"my-sentiment-dataset"},{"code":"filtered = df.filter(pl.col('score') > 0.5)\ngrouped = filtered.group_by('label').agg([\n    pl.col('score').mean().alias('avg_score'),\n    pl.col('score').count().alias('count')\n])\nresult = grouped.sort('avg_score', descending=True)","dataset_name":"my-dataset"}]},"DatasetQueryResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"result":{"title":"Result","description":"JSON-serializable query result"},"result_type":{"type":"string","enum":["dataframe","series","scalar","string","list","object","none"],"title":"Result Type","description":"Type of the returned result"},"row_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Count","description":"Number of rows if result is a DataFrame"},"columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Columns","description":"Column names if result is a DataFrame"},"execution_time_ms":{"type":"integer","title":"Execution Time Ms","description":"Execution time in milliseconds"},"truncated":{"type":"boolean","title":"Truncated","description":"Whether result was truncated due to size limits","default":false},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","dataset_name","dataset_version","result","result_type","execution_time_ms","message"],"title":"DatasetQueryResponse","description":"Response from dataset query execution."},"DatasetReference":{"properties":{"name":{"type":"string","title":"Name","description":"Dataset name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Version (latest if omitted)"}},"type":"object","required":["name"],"title":"DatasetReference","description":"Reference to a dataset by name and optional version"},"DatasetResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_path":{"type":"string","title":"Dataset Path"},"dataset_type":{"type":"string","title":"Dataset Type"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"train_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Train Ratio","description":"Train split ratio for this dataset version. Left-to-right split with no shuffle; validation is the tail."},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"version_number":{"type":"string","title":"Version Number","default":"1"},"root_dataset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Dataset Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema"},"schema_warnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Schema Warnings"},"validation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Validation"},"annotation_status":{"anyOf":[{"type":"string","enum":["none","in_progress","completed"]},{"type":"null"}],"title":"Annotation Status"},"annotation_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Annotation Config"},"annotation_progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Annotation Progress"},"status":{"anyOf":[{"type":"string","enum":["initialized","uploading","converting","validating","ready","failed","generating","queued"]},{"type":"null"}],"title":"Status","description":"Dataset status: initialized/uploading/converting/validating/ready/failed/generating/queued","default":"ready"},"processing_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Error","description":"Error message if status is failed"},"type":{"type":"string","title":"Type","description":"Dataset purpose tag: 'training', 'evaluation', or 'benchmark'","default":"training"},"visibility":{"type":"string","title":"Visibility","description":"Dataset visibility: 'private' or 'public'","default":"private"},"is_competition":{"type":"boolean","title":"Is Competition","description":"Whether this dataset is a competition benchmark","default":false},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Label names (entity types for NER, class labels for classification)"},"generation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Type","description":"How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external"},"is_seed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Seed","description":"Whether this dataset is a seed dataset (small set for review before full expansion)","default":false},"synthesis_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthesis Session Id","description":"UUID of the synthesis log session for this dataset, used to restore creation workflow on resume"},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping","description":"Column mapping from original to standard names"}},"type":"object","required":["id","user_id","dataset_name","dataset_path","dataset_type","created_at","updated_at"],"title":"DatasetResponse","description":"Response model for a single dataset."},"DatasetRowsDeleteRequest":{"properties":{"row_indices":{"anyOf":[{"items":{"type":"integer"},"type":"array","minItems":1},{"type":"null"}],"title":"Row Indices","description":"Zero-based indices of rows to remove"},"fingerprints":{"anyOf":[{"items":{"type":"string"},"type":"array","minItems":1},{"type":"null"}],"title":"Fingerprints","description":"Content fingerprints of rows to remove (position-independent)"}},"type":"object","title":"DatasetRowsDeleteRequest","description":"Request to delete specific rows from a dataset.\n\nExactly one of ``row_indices`` or ``fingerprints`` must be provided.\nFingerprint-based deletion is preferred because it is immune to\ndataset mutations between analysis and delete."},"DatasetRowsDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"dataset_name":{"type":"string","title":"Dataset Name"},"version":{"type":"string","title":"Version"},"rows_deleted":{"type":"integer","title":"Rows Deleted"},"rows_remaining":{"type":"integer","title":"Rows Remaining"},"new_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Version","description":"New version number if a new version was created"}},"type":"object","required":["dataset_name","version","rows_deleted","rows_remaining"],"title":"DatasetRowsDeleteResponse","description":"Response after deleting dataset rows."},"DatasetRowsUpdateRequest":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/RowUpdate"},"type":"array","minItems":1,"title":"Updates","description":"List of row updates to apply"}},"type":"object","required":["updates"],"title":"DatasetRowsUpdateRequest","description":"Request to update specific rows in a dataset."},"DatasetRowsUpdateResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"dataset_name":{"type":"string","title":"Dataset Name"},"version":{"type":"string","title":"Version"},"rows_updated":{"type":"integer","title":"Rows Updated"},"new_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Version","description":"New version number if a new version was created"},"validation_warnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Validation Warnings"}},"type":"object","required":["dataset_name","version","rows_updated"],"title":"DatasetRowsUpdateResponse","description":"Response after updating dataset rows."},"DatasetTypeUpdateResponse":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"}},"type":"object","required":["id","type"],"title":"DatasetTypeUpdateResponse","description":"Response after updating a dataset's use type.\n\nAttributes:\n    id: The dataset UUID.\n    type: The updated use type value."},"DatasetUpdate":{"properties":{"project_id":{"anyOf":[{"type":"string","pattern":"(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},{"type":"null"}],"title":"Project Id","description":"Project ID (UUID) to assign the dataset to, or null to unassign."}},"additionalProperties":false,"type":"object","title":"DatasetUpdate","description":"Thin PATCH body for ``PATCH /felix/datasets/{dataset_id}``.\n\nExposes only ``project_id``. Send ``null`` to unassign the dataset from its\ncurrent project. Unknown fields are rejected with HTTP 422.\n\nConvention divergence: the legacy :class:`DatasetMetadataUpdate` (used by\n``PUT /felix/datasets/{name}/{version}``) accepts ``project_id=\"\"`` for\n\"unassign\". This PATCH endpoint is the canonical path going forward and\nstandardizes on ``null``. The two schemas coexist while the frontend\nmigrates off the legacy PUT."},"DatasetUploadProcessRequest":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id","description":"Dataset ID from upload/url response (all metadata stored in DB)"}},"type":"object","required":["dataset_id"],"title":"DatasetUploadProcessRequest","description":"Request to process uploaded dataset from S3."},"DatasetUploadUrlRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Name for the dataset"},"dataset_type":{"type":"string","enum":["classification","ner","custom","decoder"],"title":"Dataset Type","description":"Type of dataset","default":"ner"},"format":{"anyOf":[{"type":"string","enum":["jsonl","csv","parquet","json"]},{"type":"null"}],"title":"Format","description":"File format (auto-detected from filename if not provided)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (used for format detection if format not provided)"},"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema","description":"Expected schema as JSON object (e.g., {\"age\": \"Int64\", \"name\": \"Utf8\"}). Enforces column types during parsing. Valid types: Int8, Int16, Int32, Int64, UInt8-64, Float32, Float64, Utf8, Boolean, Date, Datetime, Time, Duration, Categorical, Binary"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID (UUID) to assign this dataset to"},"type":{"anyOf":[{"type":"string","enum":["training","evaluation","benchmark"]},{"type":"null"}],"title":"Type","description":"Dataset purpose: 'training' (trainable), 'evaluation' (not trainable), 'benchmark' (system-managed, evaluation-only; cannot be trained on or directly accessed).","default":"training"},"visibility":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visibility","description":"Dataset visibility: 'private' (owner only) or 'public' (anyone can see)","default":"private"},"generation_type":{"anyOf":[{"type":"string","enum":["synthesize","upload","auto_relabel","manual_relabel","grow","external"]},{"type":"null"}],"title":"Generation Type","description":"How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external"},"split_ratio":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Split Ratio","description":"Split ratio when type is 'split', e.g. {'training': 0.8, 'evaluation': 0.2}"},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping","description":"Column mapping from source to standard names (e.g., {\"sentence\": \"text\", \"category\": \"label\"}). Valid standard targets: text, label, labels, entities."}},"type":"object","required":["dataset_name"],"title":"DatasetUploadUrlRequest","description":"Request to get presigned URL for dataset upload (bypasses API Gateway limits)."},"DatasetUploadUrlResponse":{"properties":{"presigned_url":{"type":"string","title":"Presigned Url","description":"S3 presigned URL for PUT upload"},"dataset_id":{"type":"string","title":"Dataset Id","description":"Dataset ID for subsequent processing"},"dataset_name":{"type":"string","title":"Dataset Name","description":"Dataset name (for polling status via GET /{name}/{version})"},"version_number":{"type":"string","title":"Version Number","description":"Version number for this dataset"},"expires_in":{"type":"integer","title":"Expires In","description":"URL expiration time in seconds"},"upload_instructions":{"type":"string","title":"Upload Instructions","description":"Instructions for completing the upload","default":"Upload file via HTTP PUT to presigned_url, then call /datasets/upload/process with dataset_id, format, and schema (if applicable)"}},"type":"object","required":["presigned_url","dataset_id","dataset_name","version_number","expires_in"],"title":"DatasetUploadUrlResponse","description":"Response with presigned S3 URL for direct upload."},"DatasetUseTypeUpdate":{"properties":{"type":{"type":"string","enum":["training","evaluation"],"title":"Type","description":"New use type: 'training' or 'evaluation'"}},"type":"object","required":["type"],"title":"DatasetUseTypeUpdate","description":"Request to change whether a dataset is used for training or evaluation.\n\nArgs:\n    type: The new use type for the dataset."},"DatasetVersionsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"versions":{"items":{"$ref":"#/components/schemas/DatasetResponse"},"type":"array","title":"Versions"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","versions","count"],"title":"DatasetVersionsResponse","description":"List of all versions of a dataset"},"DeleteAPIKeyRequest":{"properties":{"key_id":{"type":"string","title":"Key Id","description":"ID of the API key to delete"}},"type":"object","required":["key_id"],"title":"DeleteAPIKeyRequest","description":"Request model for deleting an API key."},"DeleteAccountRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"feedback_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Text"},"ownership_transfers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Ownership Transfers"}},"type":"object","title":"DeleteAccountRequest","description":"Request for account deletion with optional feedback and ownership transfers.\n\nCombines cancellation feedback with team ownership transfers so\nthe entire delete-account flow is a single atomic request.\n\nAttributes:\n    reason: Selected cancellation reason (e.g. 'Pricing').\n    feedback_text: Free-form feedback from the user.\n    ownership_transfers: Mapping of team_id to new_owner_id for\n        teams the user owns that still have other members."},"DeleteEvaluationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"DeleteEvaluationResponse","description":"Response model for deleting an evaluation."},"DeleteTrainingJobResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"DeleteTrainingJobResponse","description":"Response model for deleting a training job"},"DeleteUserResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Code"}},"type":"object","required":["status","message"],"title":"DeleteUserResponse","description":"Response for user deletion."},"DeployCheckpointResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"job_id":{"type":"string","title":"Job Id"},"checkpoint_id":{"type":"string","title":"Checkpoint Id"},"mme_path":{"type":"string","title":"Mme Path"}},"type":"object","required":["success","message","job_id","checkpoint_id","mme_path"],"title":"DeployCheckpointResponse","description":"Response after deploying a checkpoint"},"DeploymentCreate":{"properties":{"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id","description":"UUID of the training job to deploy"},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model","description":"HuggingFace base model ID to deploy (e.g. 'fastino/gliner2-base-v1'). Mutually exclusive with training_job_id."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional reason for this deployment"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"[Deprecated] Project ID. Provide in the URL path (/projects/{project_id}/deployments) instead."}},"type":"object","title":"DeploymentCreate","description":"Request body for deploying a model to a project.\n\nExactly one of ``training_job_id`` or ``base_model`` must be supplied.\n\nAttributes:\n    training_job_id: UUID of a completed training job to activate.\n    base_model: HuggingFace base model ID to activate (e.g.\n        ``fastino/gliner2-base-v1``). Used when rolling back from a\n        fine-tuned checkpoint to the original base model.\n    reason: Optional human-readable reason for the swap.\n    project_id: Project ID -- used only by the deprecated\n        /felix/deployments endpoint. For new clients, supply project_id\n        in the URL path instead."},"DeploymentHistoryResponse":{"properties":{"deployments":{"items":{"$ref":"#/components/schemas/DeploymentResponse"},"type":"array","title":"Deployments"}},"type":"object","required":["deployments"],"title":"DeploymentHistoryResponse","description":"Paginated list of deployment history records.\n\nAttributes:\n    deployments: Ordered list of deployment records (newest first)."},"DeploymentResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id"},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model"},"deployed_by":{"type":"string","title":"Deployed By"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"deployed_at":{"type":"string","format":"date-time","title":"Deployed At"}},"type":"object","required":["id","project_id","deployed_by","reason","deployed_at"],"title":"DeploymentResponse","description":"A single deployment history record.\n\nA deployment targets exactly one of ``training_job_id`` or\n``base_model``: the trained adapter that was activated, or the base\ncatalog model that was activated when no adapter is in use.\n\nAttributes:\n    id: Unique deployment record ID.\n    project_id: The project whose active model was changed.\n    training_job_id: Training job that was deployed (training-job shape).\n    base_model: HuggingFace base model ID that was deployed (base-model shape).\n    deployed_by: User ID who triggered the deployment.\n    reason: Optional reason for the swap.\n    deployed_at: When the swap occurred."},"DismissImprovementCandidateResponse":{"properties":{"training_job_id":{"type":"string","title":"Training Job Id"},"dismissed_at":{"type":"string","format":"date-time","title":"Dismissed At"}},"type":"object","required":["training_job_id","dismissed_at"],"title":"DismissImprovementCandidateResponse","description":"Response after dismissing an improvement candidate.\n\nAttributes:\n    training_job_id: Dismissed training job ID.\n    dismissed_at: Dismissal timestamp."},"DismissOutlierRequest":{"properties":{"dataset_name":{"type":"string","title":"Dataset Name","description":"Name of the dataset"},"fingerprint":{"type":"string","title":"Fingerprint","description":"Content fingerprint of the outlier sample"}},"type":"object","required":["dataset_name","fingerprint"],"title":"DismissOutlierRequest","description":"Request to dismiss (keep) an outlier so it doesn't reappear on refresh."},"DismissOutlierResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true}},"type":"object","title":"DismissOutlierResponse","description":"Response after dismissing an outlier."},"DistributionAnalysis":{"properties":{"text_length_stats":{"anyOf":[{"$ref":"#/components/schemas/DistributionStats"},{"type":"null"}]},"token_count_stats":{"anyOf":[{"$ref":"#/components/schemas/DistributionStats"},{"type":"null"}]},"token_count_histogram":{"anyOf":[{"items":{"$ref":"#/components/schemas/HistogramBucket"},"type":"array"},{"type":"null"}],"title":"Token Count Histogram"},"entity_counts":{"anyOf":[{"items":{"$ref":"#/components/schemas/EntityCount"},"type":"array"},{"type":"null"}],"title":"Entity Counts"},"span_length_stats":{"anyOf":[{"$ref":"#/components/schemas/DistributionStats"},{"type":"null"}]},"span_length_by_type":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/DistributionStats"},"type":"object"},{"type":"null"}],"title":"Span Length By Type"},"most_frequent_spans":{"anyOf":[{"items":{"$ref":"#/components/schemas/SpanFrequency"},"type":"array"},{"type":"null"}],"title":"Most Frequent Spans"},"class_balance":{"anyOf":[{"items":{"$ref":"#/components/schemas/ClassBalance"},"type":"array"},{"type":"null"}],"title":"Class Balance"},"label_correlation":{"anyOf":[{"$ref":"#/components/schemas/LabelCorrelation"},{"type":"null"}]},"prompt_length_stats":{"anyOf":[{"$ref":"#/components/schemas/DistributionStats"},{"type":"null"}]},"completion_length_stats":{"anyOf":[{"$ref":"#/components/schemas/DistributionStats"},{"type":"null"}]}},"type":"object","title":"DistributionAnalysis","description":"Result of distribution analysis"},"DistributionComparison":{"properties":{"label":{"type":"string","title":"Label"},"before_count":{"type":"integer","title":"Before Count"},"before_percentage":{"type":"number","title":"Before Percentage"},"after_count":{"type":"integer","title":"After Count"},"after_percentage":{"type":"number","title":"After Percentage"}},"type":"object","required":["label","before_count","before_percentage","after_count","after_percentage"],"title":"DistributionComparison","description":"Before/after distribution comparison."},"DistributionStats":{"properties":{"min":{"type":"number","title":"Min"},"max":{"type":"number","title":"Max"},"mean":{"type":"number","title":"Mean"},"median":{"type":"number","title":"Median"},"std":{"type":"number","title":"Std"}},"type":"object","required":["min","max","mean","median","std"],"title":"DistributionStats","description":"Statistics for a numerical distribution"},"DiversityAnalysis":{"properties":{"vendi_score":{"type":"number","title":"Vendi Score"},"sample_size":{"type":"integer","title":"Sample Size"},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interpretation"},"visualization":{"anyOf":[{"$ref":"#/components/schemas/DiversityVisualization"},{"type":"null"}]},"llm_analysis":{"anyOf":[{"$ref":"#/components/schemas/DiversityLLMAnalysis"},{"type":"null"}],"description":"LLM-generated reasoning analysis of dataset diversity, showing the thought process similar to an ML engineer"}},"type":"object","required":["vendi_score","sample_size"],"title":"DiversityAnalysis"},"DiversityLLMAnalysis":{"properties":{"reasoning_trace":{"type":"string","title":"Reasoning Trace","description":"Step-by-step reasoning trace showing how the model analyzed the dataset's diversity, similar to an ML engineer's thought process"},"summary":{"type":"string","title":"Summary","description":"Concise summary of the diversity assessment"},"diversity_rating":{"type":"string","enum":["low","moderate","high","excellent"],"title":"Diversity Rating","description":"Overall diversity rating based on the analysis"},"key_observations":{"items":{"type":"string"},"type":"array","title":"Key Observations","description":"Key observations about the dataset's diversity"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations","description":"Actionable recommendations to improve diversity if needed"},"model_used":{"type":"string","title":"Model Used","description":"The LLM model used for the analysis"}},"type":"object","required":["reasoning_trace","summary","diversity_rating","model_used"],"title":"DiversityLLMAnalysis","description":"LLM-generated reasoning analysis of dataset diversity.\n\nMimics how a machine learning engineer would analyze diversity."},"DiversityPoint":{"properties":{"x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"X"},"y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Y"},"z":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Z"},"w":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"W"},"coordinates":{"items":{"type":"number"},"type":"array","title":"Coordinates"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"token_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Count"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"sample_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Index"},"similarity_to_centroid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity To Centroid"},"embedding":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Embedding"}},"type":"object","required":["coordinates"],"title":"DiversityPoint"},"DiversityVisualization":{"properties":{"method":{"type":"string","enum":["pca","tsne"],"title":"Method"},"dimensions":{"type":"integer","title":"Dimensions"},"points":{"items":{"$ref":"#/components/schemas/DiversityPoint"},"type":"array","title":"Points"},"tsne_perplexity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tsne Perplexity"},"similarity_range":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Similarity Range"},"token_count_range":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Token Count Range"}},"type":"object","required":["method","dimensions","points"],"title":"DiversityVisualization"},"DomainLimitRequest":{"properties":{"domain":{"type":"string","maxLength":253,"minLength":1,"title":"Domain"}},"type":"object","required":["domain"],"title":"DomainLimitRequest","description":"Request body for checking domain signup limits."},"DomainLimitResponse":{"properties":{"allowed":{"type":"boolean","title":"Allowed"},"banned":{"type":"boolean","title":"Banned","default":false}},"type":"object","required":["allowed"],"title":"DomainLimitResponse","description":"Response describing whether another signup is allowed for a domain."},"DomainReportRequest":{"properties":{"domain":{"type":"string","maxLength":253,"minLength":1,"title":"Domain"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","required":["domain"],"title":"DomainReportRequest","description":"Request body for reporting a blocked domain false positive."},"DuplicateSample":{"properties":{"original_index":{"type":"integer","title":"Original Index"},"duplicate_index":{"type":"integer","title":"Duplicate Index"},"preview":{"type":"string","title":"Preview"}},"type":"object","required":["original_index","duplicate_index","preview"],"title":"DuplicateSample"},"DuplicatesAnalysis":{"properties":{"duplicate_count":{"type":"integer","title":"Duplicate Count"},"duplication_rate":{"type":"number","title":"Duplication Rate"},"samples":{"items":{"$ref":"#/components/schemas/DuplicateSample"},"type":"array","title":"Samples"}},"type":"object","required":["duplicate_count","duplication_rate","samples"],"title":"DuplicatesAnalysis"},"EmailCanonicalRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"EmailCanonicalRequest","description":"Request body for checking Gmail canonical duplicate status."},"EmailCanonicalResponse":{"properties":{"duplicate":{"type":"boolean","title":"Duplicate"}},"type":"object","required":["duplicate"],"title":"EmailCanonicalResponse","description":"Response describing whether a canonical Gmail duplicate exists."},"EmbeddingsRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Text to embed"},"model":{"type":"string","title":"Model","description":"Embedding model to use for encoding","default":"openai/text-embedding-3-small"}},"type":"object","required":["text"],"title":"EmbeddingsRequest","description":"Embedding request payload."},"EmbeddingsResponse":{"properties":{"embedding":{"items":{"type":"number"},"type":"array","title":"Embedding"}},"type":"object","required":["embedding"],"title":"EmbeddingsResponse","description":"Embedding response payload."},"EncoderInferenceRequest":{"properties":{"model_id":{"type":"string","title":"Model Id","description":"Training job ID of the fine-tuned model, or explicit encoder base model ID (for example 'fastino/gliner2-base-v1')"},"task":{"anyOf":[{"type":"string","enum":["extract_entities","classify_text","extract_json","schema"]},{"type":"null"}],"title":"Task","description":"**Deprecated** legacy encoder task hint. Omit for the unified schema path. Submitting a legacy value still succeeds but the response carries ``Deprecation: true`` and a ``Sunset`` header."},"text":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Text","description":"Text to process (single string or list for batch)"},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"}],"title":"Schema","description":"Schema for extraction. The flat ``list[str]`` form is deprecated; use the unified dict shape for forward compatibility. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` response headers."},"threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Threshold","description":"Confidence threshold","default":0.5},"include_confidence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Confidence","description":"Include confidence scores in results","default":true},"include_spans":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Spans","description":"Include character-level start/end positions","default":true},"format_results":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Format Results","description":"Format results (False for raw extraction data)","default":true},"is_warmup":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Warmup","description":"Whether this is a warmup request (not logged to history)","default":false},"store":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Store","description":"Whether to store this inference in the history table. Default true — opt out with store=false.","default":true},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID to associate with this inference. Required for base-model inferences to be picked up by LLMAJ sweeps."}},"type":"object","required":["model_id","text","schema"],"title":"EncoderInferenceRequest","description":"Inference request for encoder (GLiNER) tasks.\n\nSupports entity extraction, text classification, JSON extraction,\nand multi-task schema extraction.  ``task`` is optional — when omitted\nthe unified schema path is used (the ``schema`` value is interpreted as\na combined dict or a bare entity list).\n\nAttributes:\n    model_id: Training job ID or explicit encoder base model ID.\n    task: Legacy encoder task type.  Omit for the unified path.\n    text: Input text or list of texts for batch processing.\n    schema_: Extraction/classification schema (format depends on task).\n    threshold: Confidence threshold for predictions.\n    include_confidence: Include confidence scores in results.\n    include_spans: Include character-level start/end positions.\n    format_results: Format results (False for raw extraction data)."},"EncoderInferenceResponse":{"properties":{"type":{"type":"string","const":"encoder","title":"Type","default":"encoder"},"inference_id":{"type":"string","title":"Inference Id","description":"Unique ID for this inference record (use for feedback/correlation)"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Result","description":"Encoder inference result (format depends on task)"},"model_id":{"type":"string","title":"Model Id","description":"Training job ID used for inference"},"latency_ms":{"type":"number","title":"Latency Ms","description":"Inference latency in milliseconds"},"token_usage":{"type":"integer","title":"Token Usage","description":"Number of input tokens processed"},"model_used":{"type":"string","title":"Model Used","description":"Model identifier (for example 'fastino/gliner2-base-v1', 'Qwen/Qwen3-8B', or a training job ID)"}},"type":"object","required":["inference_id","result","model_id","latency_ms","token_usage","model_used"],"title":"EncoderInferenceResponse","description":"Response from an encoder (GLiNER) inference task.\n\nArgs:\n    type: Always ``\"encoder\"``.\n    inference_id: Unique ID for this inference record (for feedback/correlation).\n    result: Extraction/classification result (format depends on task).\n    model_id: Training job ID used for inference.\n    latency_ms: Server-side inference latency in milliseconds.\n    token_usage: Number of input tokens processed.\n    model_used: Model identifier (e.g. ``\"fastino/gliner2-base-v1\"``,\n        ``\"Qwen/Qwen3-8B\"``, or a training job ID)."},"EntityCount":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["label","count","percentage"],"title":"EntityCount"},"EvaluationCreate":{"properties":{"base_model":{"type":"string","title":"Base Model","description":"Primary model to evaluate (required). Can be a training job ID, explicit GLiNER model ID (e.g. 'fastino/gliner2-base-v1'), decoder base model ID (e.g. 'base:Qwen/Qwen3-8B'), or LLM model ID"},"comparison_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Comparison Models","description":"Optional list of models to compare against (e.g., ['fastino/gliner2-base-v1', 'gpt-4o']). Backend routing is determined from the model ID."},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id","description":"[DEPRECATED] Use base_model instead. Kept for backward compatibility."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID to associate the evaluation with"},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name of a single dataset to evaluate on (use dataset_names for multiple)"},"dataset_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Dataset Names","description":"List of dataset names to evaluate on (creates one evaluation per dataset)"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version","description":"Dataset version (latest if omitted)"},"max_examples":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Examples","description":"Max examples for LLM evaluation","default":100},"max_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens","description":"Optional max generation tokens for decoder evaluations"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for sampling","default":42},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"Task type: 'classification', 'ner', 'json_extraction', or 'decoder'"},"text_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Column","description":"Name of the text column"},"label_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Column","description":"Name of the label/tags column"}},"type":"object","required":["base_model"],"title":"EvaluationCreate","description":"Request to create a new model evaluation.\n\nSupports both single dataset (dataset_name) and multiple datasets (dataset_names).\nSupports both single model (base_model) and multiple models (base_model + comparison_models).\nWhen multiple datasets/models are provided, one evaluation is created per dataset x model combination."},"EvaluationCreateResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"evaluations":{"items":{"$ref":"#/components/schemas/EvaluationResponse"},"type":"array","title":"Evaluations"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","evaluations","count"],"title":"EvaluationCreateResponse","description":"Response for creating evaluations (supports single or multiple datasets)"},"EvaluationDatasetRow":{"properties":{"id":{"type":"string","title":"Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"version_number":{"type":"string","title":"Version Number"},"dataset_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Type","description":"Domain type of the dataset (ner, classification, custom, decoder)."},"generation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Type","description":"How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external."},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"latest_evaluation":{"anyOf":[{"$ref":"#/components/schemas/DatasetEvaluationSummary"},{"type":"null"}]}},"type":"object","required":["id","dataset_name","version_number"],"title":"EvaluationDatasetRow","description":"Dataset row rendered under the \"Evaluation datasets\" section.\n\nExtends ``TrainingDatasetRow`` with the latest completed evaluation\nagainst the model in context (project or base model)."},"EvaluationListResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"evaluations":{"items":{"$ref":"#/components/schemas/EvaluationResponse"},"type":"array","title":"Evaluations"},"count":{"type":"integer","title":"Count"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More","default":false}},"type":"object","required":["success","evaluations","count"],"title":"EvaluationListResponse","description":"Response for listing evaluations"},"EvaluationResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"model_id":{"type":"string","title":"Model Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"dataset_version":{"type":"string","title":"Dataset Version"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"f1_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"F1 Score"},"precision_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precision Score"},"recall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recall Score"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"validation_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Validation Loss"},"subset_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subset Accuracy"},"hamming_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hamming Loss"},"bleu_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bleu Score"},"rouge_l_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rouge L Score"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"total_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Cost Usd"},"total_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Latency Ms"},"max_examples":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Examples"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"status":{"type":"string","title":"Status"},"job_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Reference"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"error_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Error Count"},"error_sample":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Sample"},"sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Count"},"evaluation_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Evaluation Time Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"failed_examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Failed Examples"},"predictions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Predictions"}},"type":"object","required":["id","user_id","model_id","dataset_name","dataset_version","status","created_at"],"title":"EvaluationResponse","description":"Response for a single evaluation"},"EvaluationSummary":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type"},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version"},"f1_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"F1 Score"},"precision_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precision Score"},"recall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recall Score"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"subset_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subset Accuracy"},"hamming_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hamming Loss"},"bleu_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bleu Score"},"rouge_l_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rouge L Score"},"validation_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Validation Loss"},"sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Count"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","status"],"title":"EvaluationSummary","description":"Subset of an evaluation row surfaced on the models UI.\n\nField set mirrors the existing frontend ``EvaluationSummary`` type so\nthe TypeScript shape is unchanged."},"ExpandConstraintChoicesRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"constraint":{"$ref":"#/components/schemas/ConstraintRequest","description":"Constraint to expand"},"task_description":{"type":"string","title":"Task Description","description":"Task description for context"},"max_count":{"type":"integer","maximum":50.0,"minimum":2.0,"title":"Max Count","description":"Maximum number of choices after expansion","default":10}},"type":"object","required":["constraint","task_description"],"title":"ExpandConstraintChoicesRequest","description":"Expand constraint choices request"},"ExpandConstraintChoicesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"constraint":{"$ref":"#/components/schemas/ConstraintRequest"},"expanded_choices":{"items":{"type":"string"},"type":"array","title":"Expanded Choices"},"count":{"type":"integer","title":"Count"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage","description":"Estimated tokens used for expansion"}},"type":"object","required":["success","constraint","expanded_choices","count"],"title":"ExpandConstraintChoicesResponse","description":"Expand constraint choices response"},"FeatureFlagsResponse":{"properties":{"research_agent_enabled":{"type":"boolean","title":"Research Agent Enabled"},"mle_agent_enabled":{"type":"boolean","title":"Mle Agent Enabled"},"continuous_adaptation_agent_enabled":{"type":"boolean","title":"Continuous Adaptation Agent Enabled"},"billing_credits_page_enabled":{"type":"boolean","title":"Billing Credits Page Enabled"},"usage_insights_ui_enabled":{"type":"boolean","title":"Usage Insights Ui Enabled"}},"type":"object","required":["research_agent_enabled","mle_agent_enabled","continuous_adaptation_agent_enabled","billing_credits_page_enabled","usage_insights_ui_enabled"],"title":"FeatureFlagsResponse","description":"Resolved boolean feature flags for the requesting user.\n\nField naming follows the canonical agent names in the product:\n\n- ``research_agent_enabled``: Deep-research / multi-step research agent\n  (Datadog key ``research_agent_enabled``; renamed from the legacy\n  ``auto_agent_enabled``).\n- ``mle_agent_enabled``: Claude-powered MLE chat agent.\n- ``continuous_adaptation_agent_enabled``: Autonomous fine-tuning loop\n  (Datadog key ``continuous_adaptation_agent_enabled``; renamed from\n  the legacy ``data_engine_agent_enabled``).\n- ``usage_insights_ui_enabled``: Customer-facing usage-aware clustering\n  insights UI (ENG-2110). Decoupled from the backend classify pipeline so\n  the UI can be hidden while the backend keeps computing insights."},"GenerateAsyncResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Job ID (same as dataset_id) for polling status"},"status":{"type":"string","title":"Status","description":"Initial job status: queued or generating","default":"generating"},"dataset_name":{"type":"string","title":"Dataset Name","description":"Name of the dataset being generated"},"task_type":{"type":"string","title":"Task Type","description":"Generation task type: ner, classification, or custom"},"is_seed":{"type":"boolean","title":"Is Seed","description":"Whether this is a seed generation job","default":false},"message":{"type":"string","title":"Message","description":"Human-readable status message","default":"Generation job started"}},"type":"object","required":["job_id","dataset_name","task_type"],"title":"GenerateAsyncResponse","description":"Response from async generation job creation (HTTP 202).\n\nReturned immediately when a background generation job is started.\nThe job_id (which is the dataset_id) can be used to poll for status."},"GenerateClassificationConstraintsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"labels":{"items":{"type":"string"},"type":"array","maxItems":250,"minItems":1,"title":"Labels","description":"List of classification labels"},"min_criteria":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Min Criteria","description":"Minimum number of constraints to generate","default":5}},"type":"object","required":["labels"],"title":"GenerateClassificationConstraintsRequest","description":"Classification constraint generation request"},"GenerateConstraintsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"constraints":{"items":{"$ref":"#/components/schemas/ConstraintRequest"},"type":"array","title":"Constraints"},"count":{"type":"integer","title":"Count"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage","description":"Estimated tokens used for constraint generation"}},"type":"object","required":["success","constraints","count"],"title":"GenerateConstraintsResponse","description":"Constraint generation response"},"GenerateInferenceRequest":{"properties":{"model_id":{"type":"string","title":"Model Id","description":"Training job ID of the fine-tuned decoder model"},"task":{"type":"string","const":"generate","title":"Task","description":"Must be 'generate'"},"messages":{"items":{"$ref":"#/components/schemas/schemas__inference__ChatMessage"},"type":"array","minItems":1,"title":"Messages","description":"Chat messages in [{role, content}] format"},"max_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens","description":"Maximum tokens to generate"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature","description":"Sampling temperature"},"top_p":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Top P","description":"Top-p sampling parameter"},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ReasoningRequest"},{"type":"null"}],"description":"Opt-in reasoning / extended-thinking controls. Honored on Anthropic (native + Bedrock), OpenAI / Fireworks (effort tier only), and OpenRouter. Each field maps to the corresponding wire shape on the resolved upstream; see ReasoningRequest for per-field semantics."},"include_reasoning_trace":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Reasoning Trace","description":"When true, return extracted <think> reasoning trace separately from completion when available","default":false},"is_warmup":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Warmup","description":"Whether this is a warmup request (not logged to history)","default":false},"store":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Store","description":"Whether to store this inference in the history table. Default true — opt out with store=false.","default":true},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID to associate with this inference. Required for base-model inferences to be picked up by LLMAJ sweeps."}},"type":"object","required":["model_id","task","messages"],"title":"GenerateInferenceRequest","description":"Inference request for decoder text generation.\n\nRequires a ``messages`` array in chat format. The last message must\nhave role ``\"user\"`` so the model generates an assistant reply.\n\nArgs:\n    model_id: Training job ID of the fine-tuned decoder model.\n    task: Must be ``\"generate\"``.\n    messages: Chat messages in ``[{role, content}]`` format.\n    max_tokens: Maximum tokens to generate.\n    temperature: Sampling temperature.\n    top_p: Top-p sampling parameter.\n    reasoning: Opt-in reasoning / extended-thinking controls. See\n        :class:`ReasoningRequest` for the full field set.\n    include_reasoning_trace: Include `<think>` trace text separately in the\n        response when present."},"GenerateInferenceResponse":{"properties":{"type":{"type":"string","const":"decoder","title":"Type","default":"decoder"},"inference_id":{"type":"string","title":"Inference Id","description":"Unique ID for this inference record (use for feedback/correlation)"},"completion":{"type":"string","title":"Completion","description":"Generated text completion"},"reasoning_trace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Trace","description":"Optional extracted <think> reasoning trace text when requested"},"model_id":{"type":"string","title":"Model Id","description":"Training job ID used for inference"},"latency_ms":{"type":"number","title":"Latency Ms","description":"Inference latency in milliseconds"}},"type":"object","required":["inference_id","completion","model_id","latency_ms"],"title":"GenerateInferenceResponse","description":"Response from a decoder text generation task.\n\nArgs:\n    type: Always ``\"decoder\"``.\n    inference_id: Unique ID for this inference record (for feedback/correlation).\n    completion: Generated text from the model.\n    reasoning_trace: Optional extracted `<think>` trace text when requested.\n    model_id: Training job ID used for inference.\n    latency_ms: Server-side inference latency in milliseconds."},"GenerateJobStatus":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Job ID (same as dataset_id)"},"status":{"type":"string","title":"Status","description":"Job status: queued, generating, ready, failed"},"data":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Data","description":"Generated data rows (only present when status is 'ready')"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count","description":"Number of generated rows (only present when status is 'ready')"},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"Generation task type: ner, classification, or custom"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage","description":"Estimated tokens used (only present when status is 'ready')"},"dataset":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dataset","description":"Dataset info (only present when status is 'ready')"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message (only present when status is 'failed')"},"is_seed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Seed","description":"Whether this is a seed dataset"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Job creation timestamp"}},"type":"object","required":["job_id","status"],"title":"GenerateJobStatus","description":"Response from job status polling endpoint.\n\nReturns current status and, when complete, the generated data."},"GenerateNERConstraintsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"List of entity labels"},"min_criteria":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Min Criteria","description":"Minimum number of constraints to generate","default":5}},"type":"object","required":["labels"],"title":"GenerateNERConstraintsRequest","description":"NER constraint generation request"},"GenerateRecordsConstraintsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"fields":{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array","title":"Fields","description":"Field definitions for structured records"},"min_criteria":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Min Criteria","description":"Minimum number of constraints to generate","default":5}},"type":"object","required":["fields"],"title":"GenerateRecordsConstraintsRequest","description":"Records constraint generation request"},"GenerateRequest":{"properties":{"task_type":{"type":"string","enum":["ner","classification","custom","decoder","records","fields"],"title":"Task Type","description":"Type of generation task"},"dataset_name":{"type":"string","minLength":1,"title":"Dataset Name","description":"Name for the generated dataset"},"num_examples":{"type":"integer","maximum":5000.0,"minimum":1.0,"title":"Num Examples","description":"Number of examples to generate","default":10},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context (required for decoder)"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"Generation temperature","default":0.7},"quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality","description":"Generation quality: 'light', 'medium', or 'heavy'"},"generation_profile":{"type":"string","enum":["auto","fast","balanced","quality"],"title":"Generation Profile","description":"Queue/runtime execution profile. 'auto' selects a task-aware default.","default":"auto"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for log streaming"},"config_num_examples":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Config Num Examples","description":"Number of examples to use for config generation","default":5},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for reproducibility"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":250},{"type":"null"}],"title":"Labels","description":"Entity/classification labels (required for ner and classification)"},"classified_examples":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/NERClassifiedExample"},{"$ref":"#/components/schemas/ClassifiedExample"}]},"type":"array"},{"type":"null"}],"title":"Classified Examples","description":"Seed examples for generation. NER: {text, entities: [[span, label], ...], feedback?}. Classification: {text, label, feedback?}."},"multi_label":{"type":"boolean","title":"Multi Label","description":"Enable multi-label classification (classification only)","default":false},"class_balance":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Class Balance","description":"Optional class distribution map (classification only)"},"batch_size":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Batch Size","description":"Batch size for generation API calls","default":5},"negative_ratio":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Negative Ratio","description":"Percentage of rows with no labels (NER negative samples)"},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array"},{"type":"null"}],"title":"Fields","description":"Field definitions for structured records (required for records)"},"input_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array"},{"type":"null"}],"title":"Input Fields","description":"Input field definitions (required for fields)"},"output_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array"},{"type":"null"}],"title":"Output Fields","description":"Output field definitions (required for fields)"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"Natural language prompt describing the task (required for custom)"},"output_format":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Format","description":"Expected output schema for custom generation"},"infer_output_format":{"type":"boolean","title":"Infer Output Format","description":"Infer output format from prompt when output_format is absent","default":false},"instruction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction","description":"System instruction for decoder chat format"},"include_reasoning_trace":{"type":"boolean","title":"Include Reasoning Trace","description":"Whether to include reasoning traces (<think> blocks) in generated outputs for decoder tasks. Ignored when task_type is not 'decoder'.","default":false},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort","description":"Reasoning effort for the underlying LLM (e.g., 'low', 'medium', 'high')"},"constraints":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConstraintRequest"},"type":"array"},{"type":"null"}],"title":"Constraints","description":"Custom constraints applied to all generated examples"},"multiplicator":{"anyOf":[{"$ref":"#/components/schemas/MultiplicatorRequest"},{"type":"null"}],"description":"Multiplicator for balanced distribution across choices"},"use_meta_felix":{"type":"boolean","title":"Use Meta Felix","description":"Use MetaFelix for auto-generating diversity criteria","default":true},"min_criteria":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Min Criteria","description":"Minimum diversity criteria to generate","default":10},"target_choices":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Target Choices","description":"Number of choices to expand for diversity","default":15},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id","description":"Project ID to assign the dataset to"},"type":{"type":"string","title":"Type","description":"Dataset type tag: 'training', 'evaluation', or 'split'","default":"training"},"visibility":{"type":"string","title":"Visibility","description":"Dataset visibility: 'private' or 'public'","default":"private"},"split_ratio":{"anyOf":[{"$ref":"#/components/schemas/SplitRatioConfig"},{"type":"null"}],"description":"Split ratio when type is 'split'. Ignored otherwise."}},"type":"object","required":["task_type","dataset_name"],"title":"GenerateRequest","description":"Unified async generation request for all task types.\n\nUse ``task_type`` to specify what kind of dataset to generate.\nAll generation goes through SQS with BackgroundTasks fallback.\n\nTask-specific required fields:\n- ``ner``: requires ``labels``\n- ``classification``: requires ``labels``\n- ``custom``: requires ``prompt``\n- ``decoder``: requires ``domain_description``\n- ``records``: requires ``fields``\n- ``fields``: requires ``input_fields`` and ``output_fields``"},"GenerateResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"},"task_type":{"type":"string","title":"Task Type"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage","description":"Estimated tokens used for generation"},"dataset":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dataset","description":"Dataset info if saved to S3/database"}},"type":"object","required":["success","data","count","task_type"],"title":"GenerateResponse","description":"Generation response"},"GlinerJobStatus":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","status","created_at"],"title":"GlinerJobStatus","description":"Response from job status check."},"GlinerRequest":{"properties":{"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"**Deprecated** legacy task hint. One of: 'extract_entities', 'classify_text', 'extract_json', 'schema'. Omit for the unified GLiNER2 path. Submitting a legacy task value still succeeds but the response carries ``Deprecation: true`` and a ``Sunset`` header."},"text":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Text"},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"}],"title":"Schema","description":"Extraction schema. The flat ``list[str]`` of entity labels is deprecated; use the unified dict shape (``entities`` / ``classifications`` / ``structures`` / ``relations``) for forward compatibility. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold","default":0.5},"include_confidence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Confidence","default":true},"include_spans":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Spans","default":true},"format_results":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Format Results","default":true}},"type":"object","required":["text","schema"],"title":"GlinerRequest","description":"Request for GLiNER-2 processing (sync)."},"GlinerResponse":{"properties":{"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Result"},"token_usage":{"type":"integer","title":"Token Usage"}},"type":"object","required":["result","token_usage"],"title":"GlinerResponse","description":"Response from GLiNER-2 processing."},"GrowDatasetRequest":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id","description":"ID of the existing dataset to grow from"},"new_dataset_name":{"type":"string","maxLength":255,"minLength":1,"title":"New Dataset Name","description":"Name for the new grown dataset"},"target_size":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Target Size","description":"Total number of examples in the final dataset"},"class_balance":{"type":"boolean","title":"Class Balance","description":"If True, balance classes equally. If False, generate equal examples per source example.","default":true},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Override domain description for generation context"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"Generation temperature","default":0.7},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for log streaming"}},"type":"object","required":["dataset_id","new_dataset_name","target_size"],"title":"GrowDatasetRequest","description":"Request to grow an existing dataset by generating new examples.\n\nSupports both classification and NER datasets. When class_balance is enabled,\ngenerates equal examples per class. Otherwise, generates equal examples per\nsource example from the original dataset."},"GrowDatasetResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the operation succeeded"},"dataset":{"additionalProperties":true,"type":"object","title":"Dataset","description":"New dataset info (id, name, path, version)"},"original_size":{"type":"integer","title":"Original Size","description":"Number of examples in the original dataset"},"new_size":{"type":"integer","title":"New Size","description":"Total number of examples in the new dataset"},"generated_count":{"type":"integer","title":"Generated Count","description":"Number of new examples generated"},"distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Distribution","description":"Number of examples generated per class/label"},"token_usage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Usage","description":"Estimated tokens used for generation"}},"type":"object","required":["success","dataset","original_size","new_size","generated_count","distribution"],"title":"GrowDatasetResponse","description":"Response from dataset grow operation."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HistogramBucket":{"properties":{"range":{"type":"string","title":"Range"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["range","count"],"title":"HistogramBucket"},"HuggingFaceDisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the disconnect succeeded."}},"type":"object","required":["success"],"title":"HuggingFaceDisconnectResponse","description":"Response for disconnecting a HuggingFace connection."},"HuggingFaceOAuthStateRequest":{"properties":{"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Url","description":"Optional post-connect redirect URL."}},"type":"object","title":"HuggingFaceOAuthStateRequest","description":"Request body for creating a HuggingFace OAuth state token."},"HuggingFaceOAuthStateResponse":{"properties":{"state_token":{"type":"string","title":"State Token","description":"Generated state token."}},"type":"object","required":["state_token"],"title":"HuggingFaceOAuthStateResponse","description":"Response containing the generated HuggingFace OAuth state token."},"HuggingFacePullPreviewResponse":{"properties":{"preview_rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Preview Rows","description":"Sample rows from the dataset (first 50 rows)"},"total_rows":{"type":"integer","title":"Total Rows","description":"Total number of rows in the dataset"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns","description":"List of column names"},"dataset_type":{"type":"string","title":"Dataset Type","description":"Inferred dataset type (classification, ner, custom)"},"schema_":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Schema","description":"Inferred schema mapping column names to data types"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Dataset metadata from HuggingFace"}},"type":"object","required":["preview_rows","total_rows","columns","dataset_type"],"title":"HuggingFacePullPreviewResponse","description":"Response containing preview data from a HuggingFace dataset pull (without saving)."},"HuggingFacePullRequest":{"properties":{"repo_id":{"type":"string","title":"Repo Id","description":"HuggingFace repo ID to pull from"},"revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision","description":"Specific revision/branch to pull"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name for the local dataset (defaults to repo name)"},"hf_token":{"type":"string","title":"Hf Token","description":"HuggingFace API token"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for SSE log streaming"},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping","description":"Column mapping from source to standard names"},"dataset_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Type","description":"Dataset type (ner, classification, custom)"}},"type":"object","required":["repo_id","hf_token"],"title":"HuggingFacePullRequest","description":"Request to pull dataset from HuggingFace Hub."},"HuggingFacePushModelRequest":{"properties":{"repo_id":{"type":"string","title":"Repo Id","description":"HuggingFace repo ID (e.g., 'username/model-name')"},"hf_token":{"type":"string","title":"Hf Token","description":"HuggingFace API token with write permissions"},"private":{"type":"boolean","title":"Private","description":"Whether repo should be private","default":true},"commit_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commit Message","description":"Optional commit message for the push"}},"type":"object","required":["repo_id","hf_token"],"title":"HuggingFacePushModelRequest","description":"Request to push a trained model to HuggingFace Hub"},"HuggingFacePushRequest":{"properties":{"repo_id":{"type":"string","title":"Repo Id","description":"HuggingFace repo ID (e.g., 'user/dataset')"},"private":{"type":"boolean","title":"Private","description":"Whether repo should be private","default":true},"commit_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commit Message","description":"Commit message for the push"},"hf_token":{"type":"string","title":"Hf Token","description":"HuggingFace API token"}},"type":"object","required":["repo_id","hf_token"],"title":"HuggingFacePushRequest","description":"Request to push dataset to HuggingFace Hub."},"ImageContentBlock":{"properties":{"type":{"type":"string","const":"image","title":"Type","default":"image"},"source":{"$ref":"#/components/schemas/ImageSource"}},"type":"object","required":["source"],"title":"ImageContentBlock","description":"Anthropic image content block."},"ImageSource":{"properties":{"type":{"type":"string","enum":["base64","url"],"title":"Type"},"media_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Type"},"data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["type"],"title":"ImageSource","description":"Anthropic image source (base64 or HTTPS URL)."},"ImprovePromptRequest":{"properties":{"prompt":{"type":"string","minLength":1,"title":"Prompt","description":"The user's original prompt to improve"},"data_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Type","description":"The dataset type (classification, entity_extraction, json_extraction)"}},"type":"object","required":["prompt"],"title":"ImprovePromptRequest","description":"Request to improve a dataset generation prompt."},"ImprovePromptResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"improved_prompt":{"type":"string","title":"Improved Prompt"},"summary":{"type":"string","title":"Summary","description":"Short summary of what was improved"}},"type":"object","required":["success","improved_prompt","summary"],"title":"ImprovePromptResponse","description":"Response containing the improved prompt."},"ImprovementCandidate":{"properties":{"project_id":{"type":"string","title":"Project Id"},"project_name":{"type":"string","title":"Project Name"},"training_job_id":{"type":"string","title":"Training Job Id"},"adapter_name":{"type":"string","title":"Adapter Name"},"base_model":{"type":"string","title":"Base Model"},"score":{"type":"number","title":"Score"},"score_name":{"type":"string","title":"Score Name"},"eval_metrics":{"additionalProperties":true,"type":"object","title":"Eval Metrics"},"eval_sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eval Sample Count"},"evaluated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Evaluated At"},"training_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Training Completed At"},"source":{"type":"string","enum":["agent_selected","evaluation_fallback"],"title":"Source"},"agent_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Run Id"},"agent_remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Remarks"}},"type":"object","required":["project_id","project_name","training_job_id","adapter_name","base_model","score","score_name","eval_metrics","source"],"title":"ImprovementCandidate","description":"A deployable adapter candidate for the monitoring homepage.\n\nAttributes:\n    project_id: Project that owns the candidate adapter.\n    project_name: Display name of the project.\n    training_job_id: Training job backing the adapter.\n    adapter_name: Display name of the adapter.\n    base_model: Base model used by the adapter.\n    score: Backend-computed priority score.\n    score_name: Metric name used for the score.\n    eval_metrics: Raw evaluation metrics for display details.\n    eval_sample_count: Number of examples used by the evaluation.\n    evaluated_at: Evaluation completion timestamp.\n    training_completed_at: Training completion timestamp.\n    source: Selection source.\n    agent_run_id: Agent run that selected the candidate, if applicable.\n    agent_remarks: Agent remarks, if applicable."},"ImprovementCandidatesResponse":{"properties":{"candidates":{"items":{"$ref":"#/components/schemas/ImprovementCandidate"},"type":"array","title":"Candidates"}},"type":"object","required":["candidates"],"title":"ImprovementCandidatesResponse","description":"Response for listing monitoring improvement candidates.\n\nAttributes:\n    candidates: Improvement candidates after workspace-level filtering."},"ImprovementTimeseriesResponse":{"properties":{"base_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model Id"},"base_model_eval":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResponse"},{"type":"null"}]},"adapters":{"items":{"$ref":"#/components/schemas/AdapterTimeseriesEntry"},"type":"array","title":"Adapters"}},"type":"object","required":["adapters"],"title":"ImprovementTimeseriesResponse","description":"Grouped training-job + evals + base-model-eval for a project.\n\nThe ``adapters`` list is ordered by training-job creation date\ndescending (newest first). Re-sorting for display (e.g. ascending\nby score) is handled on the frontend.\n\nAttributes:\n    base_model_id: The shared base-model string used by adapters in\n        this project (e.g. ``\"base:Qwen/Qwen3-8B\"``).  None when the\n        project has no training jobs yet.\n    base_model_eval: Latest completed evaluation against the base model.\n        None when no base-model evaluation exists.\n    adapters: Training jobs with their evaluations, newest first."},"InferAdvancedRequest":{"properties":{"prompt":{"type":"string","minLength":1,"title":"Prompt","description":"The user's dataset generation prompt"},"data_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Type","description":"The dataset type (classification, entity_extraction, json_extraction)"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"The labels / entity types / classes for the dataset"}},"type":"object","required":["prompt"],"title":"InferAdvancedRequest","description":"Request to infer constraints and multiplicator from a prompt."},"InferAdvancedResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"constraints":{"items":{"$ref":"#/components/schemas/InferredConstraint"},"type":"array","title":"Constraints","description":"Suggested constraints for the generation"},"multiplicator":{"anyOf":[{"$ref":"#/components/schemas/InferredMultiplicator"},{"type":"null"}],"description":"Suggested multiplicator for balanced distribution"}},"type":"object","required":["success"],"title":"InferAdvancedResponse","description":"Response containing inferred constraints and multiplicator."},"InferClassificationLabelsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"type":"string","title":"Domain Description","description":"Domain description for inferring classification labels"}},"type":"object","required":["domain_description"],"title":"InferClassificationLabelsRequest","description":"Classification label inference request"},"InferFieldsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"type":"string","title":"Domain Description","description":"Domain description for field inference"}},"type":"object","required":["domain_description"],"title":"InferFieldsRequest","description":"Request to infer fields from domain description"},"InferFieldsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"input_fields":{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array","title":"Input Fields"},"output_fields":{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array","title":"Output Fields"},"mode":{"type":"string","title":"Mode"},"reasoning":{"type":"string","title":"Reasoning"}},"type":"object","required":["success","input_fields","output_fields","mode","reasoning"],"title":"InferFieldsResponse","description":"Field inference response"},"InferLabelsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","labels","count"],"title":"InferLabelsResponse","description":"Label inference response"},"InferNERLabelsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"domain_description":{"type":"string","title":"Domain Description","description":"Domain description for inferring entity types"}},"type":"object","required":["domain_description"],"title":"InferNERLabelsRequest","description":"NER label inference request"},"InferenceClusterBaseModelGroup":{"properties":{"base_model":{"type":"string","title":"Base Model"},"variants":{"items":{"$ref":"#/components/schemas/InferenceClusterVariantGroup"},"type":"array","title":"Variants"}},"type":"object","required":["base_model"],"title":"InferenceClusterBaseModelGroup","description":"Cluster groups for one base model.\n\nAttributes:\n    base_model: Base model identifier.\n    variants: Variant groups under this base model."},"InferenceClusterCard":{"properties":{"id":{"type":"string","title":"Id"},"rank":{"type":"integer","title":"Rank"},"status":{"type":"string","enum":["open","reopened","resolved","ignored"],"title":"Status"},"severity":{"type":"string","enum":["high","mid","low"],"title":"Severity"},"failure_label":{"type":"string","title":"Failure Label"},"failure_label_slug":{"type":"string","title":"Failure Label Slug"},"task_domain_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Domain Label"},"task_domain_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Domain Slug"},"usage_taxonomy_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Taxonomy Label"},"usage_taxonomy_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Taxonomy Slug"},"root_cause_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause Label"},"root_cause_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause Slug"},"summary":{"type":"string","title":"Summary"},"failure_facts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Failure Facts"},"root_causes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Root Causes"},"metrics":{"$ref":"#/components/schemas/InferenceClusterMetrics"},"representative_examples":{"items":{"$ref":"#/components/schemas/InferenceClusterExample"},"type":"array","title":"Representative Examples"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"last_refresh_failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refresh Failed At"},"last_refresh_error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Refresh Error Message"},"last_member_added_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Member Added At"}},"type":"object","required":["id","rank","status","severity","failure_label","failure_label_slug","summary","created_at","updated_at"],"title":"InferenceClusterCard","description":"Cluster summary returned in project cluster lists.\n\nAttributes:\n    id: Cluster ID.\n    rank: Rank within the selected project/model/window.\n    status: Cluster lifecycle status.\n    severity: User-facing severity bucket.\n    failure_label: Display label for the failure mode.\n    summary: Short explanation of why this cluster failed.\n    metrics: Metrics for the selected window."},"InferenceClusterDetail":{"properties":{"id":{"type":"string","title":"Id"},"rank":{"type":"integer","title":"Rank"},"status":{"type":"string","enum":["open","reopened","resolved","ignored"],"title":"Status"},"severity":{"type":"string","enum":["high","mid","low"],"title":"Severity"},"failure_label":{"type":"string","title":"Failure Label"},"failure_label_slug":{"type":"string","title":"Failure Label Slug"},"task_domain_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Domain Label"},"task_domain_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Domain Slug"},"usage_taxonomy_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Taxonomy Label"},"usage_taxonomy_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Taxonomy Slug"},"root_cause_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause Label"},"root_cause_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause Slug"},"summary":{"type":"string","title":"Summary"},"failure_facts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Failure Facts"},"root_causes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Root Causes"},"metrics":{"$ref":"#/components/schemas/InferenceClusterMetrics"},"representative_examples":{"items":{"$ref":"#/components/schemas/InferenceClusterExample"},"type":"array","title":"Representative Examples"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"last_refresh_failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refresh Failed At"},"last_refresh_error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Refresh Error Message"},"last_member_added_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Member Added At"},"project_id":{"type":"string","title":"Project Id"},"base_model":{"type":"string","title":"Base Model"},"variant_type":{"type":"string","enum":["base","adapter"],"title":"Variant Type"},"model_id":{"type":"string","title":"Model Id"},"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id"},"metrics_by_window":{"additionalProperties":true,"type":"object","title":"Metrics By Window"},"member_count":{"type":"integer","title":"Member Count","default":0},"representative_inference_ids":{"items":{"type":"string"},"type":"array","title":"Representative Inference Ids"}},"type":"object","required":["id","rank","status","severity","failure_label","failure_label_slug","summary","created_at","updated_at","project_id","base_model","variant_type","model_id"],"title":"InferenceClusterDetail","description":"Detailed response for a single cluster.\n\nAttributes:\n    project_id: Project ID that owns the cluster.\n    base_model: Base model identifier.\n    variant_type: Base or adapter variant.\n    model_id: Inference model ID.\n    training_job_id: Training job ID for adapter variants.\n    metrics_by_window: All persisted window metrics.\n    member_count: Total active member count."},"InferenceClusterExample":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"input":{"type":"string","title":"Input"},"output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"title":"Output"},"llmaj_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llmaj Verdict"},"llmaj_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llmaj Score"},"llmaj_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llmaj Reasoning"},"llmaj_corrected_output":{"anyOf":[{},{"type":"null"}],"title":"Llmaj Corrected Output"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id"},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model"},"provider":{"type":"string","title":"Provider"},"full_record":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Full Record"}},"type":"object","required":["id","input","provider"],"title":"InferenceClusterExample","description":"Compact inference record used in cluster card/examples responses.\n\nAttributes:\n    id: Inference ID.\n    created_at: When the inference was recorded.\n    input: Raw input stored on the inference.\n    output: Model output stored on the inference. May be a structured dict\n        for parser-style models or a plain string for free-form decoder\n        outputs and refusals.\n    llmaj_verdict: LLMAJ verdict for this inference.\n    llmaj_score: Optional LLMAJ score.\n    llmaj_reasoning: Judge explanation for the verdict.\n    llmaj_corrected_output: Optional judge-provided corrected output."},"InferenceClusterInferencesResponse":{"properties":{"cluster_id":{"type":"string","title":"Cluster Id"},"role":{"type":"string","enum":["members","pass_context"],"title":"Role"},"inferences":{"items":{"$ref":"#/components/schemas/InferenceClusterExample"},"type":"array","title":"Inferences"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["cluster_id","role","inferences","total","limit","offset"],"title":"InferenceClusterInferencesResponse","description":"Paginated inference list for cluster members or pass context.\n\nAttributes:\n    cluster_id: Cluster ID.\n    role: Which inference set was returned.\n    inferences: Paginated inference records.\n    total: Total records matching this request.\n    limit: Page limit.\n    offset: Page offset."},"InferenceClusterMetrics":{"properties":{"not_pass_count":{"type":"integer","title":"Not Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0},"uncertain_count":{"type":"integer","title":"Uncertain Count","default":0},"affected_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Rate"},"total_judged":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Judged"}},"type":"object","title":"InferenceClusterMetrics","description":"Windowed metrics for a cluster.\n\nAttributes:\n    not_pass_count: Number of fail or uncertain inferences.\n    fail_count: Number of fail verdicts.\n    uncertain_count: Number of uncertain verdicts.\n    affected_rate: Fraction of judged inferences affected by the cluster\n        (``not_pass_count / total_judged``).\n    total_judged: Denominator used to compute ``affected_rate`` — the\n        number of same-scope judged inferences in the window. Surfaced\n        so dashboard cards can render ``n / N`` and the frontend can\n        verify that all cards in the same group share the same\n        denominator."},"InferenceClusterUpdate":{"properties":{"status":{"type":"string","enum":["open","reopened","resolved","ignored"],"title":"Status"}},"type":"object","required":["status"],"title":"InferenceClusterUpdate","description":"Request body for updating a cluster.\n\nAttributes:\n    status: New cluster lifecycle status."},"InferenceClusterVariantGroup":{"properties":{"variant_type":{"type":"string","enum":["base","adapter"],"title":"Variant Type"},"model_id":{"type":"string","title":"Model Id"},"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id"},"clusters":{"items":{"$ref":"#/components/schemas/InferenceClusterCard"},"type":"array","title":"Clusters"}},"type":"object","required":["variant_type","model_id"],"title":"InferenceClusterVariantGroup","description":"Clusters for one base or adapter variant.\n\nAttributes:\n    variant_type: Whether the variant is a base model or adapter.\n    model_id: Model ID used by the inference rows.\n    training_job_id: Adapter training job ID, when applicable.\n    clusters: Ranked cluster cards for this variant."},"InferenceFeedbackRequest":{"properties":{"verdict":{"type":"string","enum":["correct","incorrect"],"title":"Verdict","description":"Human judgment: 'correct' or 'incorrect'"},"corrected_output":{"anyOf":[{},{"type":"null"}],"title":"Corrected Output","description":"Expected output for incorrect verdicts (JSON structure matching task output)"},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Notes","description":"Optional reviewer notes"}},"type":"object","required":["verdict"],"title":"InferenceFeedbackRequest","description":"Request to submit human feedback on a specific inference.\n\nArgs:\n    verdict: Human judgment — correct or incorrect.\n    corrected_output: Expected output when verdict is incorrect.\n    notes: Optional free-text notes from the reviewer."},"InferenceFeedbackResponse":{"properties":{"inference_id":{"type":"string","title":"Inference Id","description":"Inference ID that was annotated"},"human_verdict":{"type":"string","title":"Human Verdict","description":"Stored human verdict"},"human_feedback_at":{"type":"string","format":"date-time","title":"Human Feedback At","description":"When the feedback was submitted"}},"type":"object","required":["inference_id","human_verdict","human_feedback_at"],"title":"InferenceFeedbackResponse","description":"Response after submitting human feedback.\n\nArgs:\n    inference_id: The inference that was annotated.\n    human_verdict: The stored verdict.\n    human_feedback_at: Timestamp of the feedback submission."},"InferenceListResponse":{"properties":{"inferences":{"items":{"$ref":"#/components/schemas/InferenceRecord"},"type":"array","title":"Inferences","description":"List of inference records"},"total":{"type":"integer","title":"Total","description":"Total count of inferences matching filters"},"limit":{"type":"integer","title":"Limit","description":"Page size limit"},"offset":{"type":"integer","title":"Offset","description":"Current offset"}},"type":"object","required":["inferences","total","limit","offset"],"title":"InferenceListResponse","description":"Response for listing inference history."},"InferenceRecord":{"properties":{"id":{"type":"string","title":"Id","description":"Unique inference ID"},"user_id":{"type":"string","title":"User Id","description":"User who made the inference"},"model_id":{"type":"string","title":"Model Id","description":"Model ID used for inference"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name","description":"Human-readable model name"},"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"Task type (legacy; may be NULL for new inferences)"},"input":{"type":"string","title":"Input","description":"Input text"},"output":{"anyOf":[{},{"type":"null"}],"title":"Output","description":"Inference output (JSON)"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms","description":"Latency in milliseconds"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens","description":"Token count"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens","description":"Non-cached input/prompt tokens, sourced from the metered requests row. None when no billing row was recorded."},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens","description":"Output/completion tokens, sourced from the metered requests row."},"cache_read_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Read Tokens","description":"Input tokens served from the provider prompt cache (cache hit)."},"cache_write_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Write Tokens","description":"Input tokens written into the provider prompt cache (cache creation). Zero for providers that bill writes as plain input."},"source":{"type":"string","title":"Source","description":"Source of the request (api or ui)","default":"api"},"status":{"type":"string","title":"Status","description":"Inference status: success or failed","default":"success"},"error_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Type","description":"Failure category when status is failed (validation, timeout, model_not_ready, model_not_found, model_not_supported, capacity_exhausted, internal)"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error detail when status is failed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the inference was made"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID the model belongs to"},"training_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Training Job Id","description":"Training job UUID that produced the model"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider","description":"Inference provider (aws, modal, fireworks, etc.)"},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model","description":"HuggingFace base model ID"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Extensible metadata (e.g. LLM judge results)"},"human_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Human Verdict","description":"Human reviewer verdict (correct/incorrect)"},"human_corrected_output":{"anyOf":[{},{"type":"null"}],"title":"Human Corrected Output","description":"Expected output from human reviewer"},"human_feedback_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Human Feedback Notes","description":"Optional reviewer notes"},"human_feedback_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Human Feedback At","description":"When human feedback was submitted"},"llmaj_verdict":{"anyOf":[{"type":"string","enum":["pass","fail","uncertain"]},{"type":"null"}],"title":"Llmaj Verdict","description":"LLMAJ judge verdict ('pass', 'fail', or 'uncertain'); None until judged."},"llmaj_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llmaj Score","description":"LLMAJ judge confidence score in [0.0, 1.0]; None until judged."},"llmaj_judged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Llmaj Judged At","description":"Timestamp when LLMAJ judgment was recorded; None until judged."},"llmaj_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llmaj Reasoning","description":"LLMAJ judge reasoning/explanation; None until judged."}},"type":"object","required":["id","user_id","model_id","input","created_at"],"title":"InferenceRecord","description":"Stored inference record from the database.\n\nAttributes:\n    status: Inference outcome -- 'success' or 'failed'.\n    error_type: Failure category when status is 'failed'.\n    error_message: Error detail when status is 'failed'."},"InferredConstraint":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable constraint description"},"choices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Choices","description":"Optional choice list"},"probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Probability","description":"Optional probability"}},"type":"object","required":["description"],"title":"InferredConstraint","description":"A single inferred constraint."},"InferredMultiplicator":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"The dimension prompt, e.g. 'The sentiment should be'"},"choices":{"items":{"type":"string"},"type":"array","title":"Choices","description":"Choices to balance across"}},"type":"object","required":["prompt","choices"],"title":"InferredMultiplicator","description":"An inferred multiplicator dimension."},"InvitationActionResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"invitation_id":{"type":"string","title":"Invitation Id"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"}},"type":"object","required":["success","message","invitation_id"],"title":"InvitationActionResponse","description":"Response model for accepting or declining an invitation."},"InvitationStatus":{"type":"string","enum":["pending","accepted","declined","expired"],"title":"InvitationStatus","description":"Status of a team invitation."},"LabelCheckResult":{"properties":{"row_index":{"type":"integer","title":"Row Index"},"text":{"type":"string","title":"Text"},"current_label":{"type":"string","title":"Current Label"},"suggested_label":{"type":"string","title":"Suggested Label"},"confidence":{"type":"number","title":"Confidence"},"reasoning":{"type":"string","title":"Reasoning"}},"type":"object","required":["row_index","text","current_label","suggested_label","confidence","reasoning"],"title":"LabelCheckResult","description":"Result of checking a single label"},"LabelCorrelation":{"properties":{"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"matrix":{"items":{"items":{"type":"integer"},"type":"array"},"type":"array","title":"Matrix"}},"type":"object","required":["labels","matrix"],"title":"LabelCorrelation"},"LabelDistribution":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["label","count","percentage"],"title":"LabelDistribution"},"LabelExistingClassificationRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"List of classification labels"},"inputs":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Inputs","description":"List of texts to label"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for reproducibility"},"class_balance":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Class Balance","description":"Optional class distribution (must sum to 1.0)"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for log streaming"},"config_num_examples":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Config Num Examples","description":"Number of examples to generate for config","default":5},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"Generation temperature","default":0.7},"batch_size":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Batch Size","description":"Number of samples to generate per API call","default":5},"constraints":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConstraintRequest"},"type":"array"},{"type":"null"}],"title":"Constraints","description":"Custom constraints"},"multi_label":{"type":"boolean","title":"Multi Label","description":"Enable multi-label classification (samples can have multiple labels)","default":false},"save_dataset":{"type":"boolean","title":"Save Dataset","description":"Save generated dataset to S3 and database","default":false},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name for the saved dataset (required if save_dataset=True)"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id","description":"Project ID to assign the dataset to"}},"type":"object","required":["labels","inputs"],"title":"LabelExistingClassificationRequest","description":"Label existing texts for classification"},"LabelExistingFieldsRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"input_fields":{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array","title":"Input Fields","description":"Input field definitions"},"output_fields":{"items":{"$ref":"#/components/schemas/RecordField"},"type":"array","title":"Output Fields","description":"Output field definitions"},"inputs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":1000,"minItems":1,"title":"Inputs","description":"List of input data dictionaries"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for reproducibility"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for log streaming"},"config_num_examples":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Config Num Examples","description":"Number of examples to generate for config","default":5},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"Generation temperature","default":0.7},"constraints":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConstraintRequest"},"type":"array"},{"type":"null"}],"title":"Constraints","description":"Custom constraints"},"save_dataset":{"type":"boolean","title":"Save Dataset","description":"Save generated dataset to S3 and database","default":false},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name for the saved dataset (required if save_dataset=True)"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id","description":"Project ID to assign the dataset to"}},"type":"object","required":["input_fields","output_fields","inputs"],"title":"LabelExistingFieldsRequest","description":"Label existing data with custom input/output fields"},"LabelExistingNERRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (optional, uses authenticated user if not provided)"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"List of entity labels (e.g., ['PERSON', 'ORG', 'LOC'])"},"inputs":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Inputs","description":"List of texts to label"},"domain_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Description","description":"Domain description for generation context"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Random seed for reproducibility"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for log streaming"},"config_num_examples":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Config Num Examples","description":"Number of examples to generate for config","default":5},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"Generation temperature","default":0.7},"constraints":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConstraintRequest"},"type":"array"},{"type":"null"}],"title":"Constraints","description":"Custom constraints"},"save_dataset":{"type":"boolean","title":"Save Dataset","description":"Save generated dataset to S3 and database","default":false},"dataset_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Name","description":"Name for the saved dataset (required if save_dataset=True)"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id","description":"Project ID to assign the dataset to"}},"type":"object","required":["labels","inputs"],"title":"LabelExistingNERRequest","description":"Label existing texts for NER"},"LatencyTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date","description":"ISO date or datetime string"},"avg_latency_ms":{"type":"number","title":"Avg Latency Ms"},"p50_latency_ms":{"type":"number","title":"P50 Latency Ms"},"p95_latency_ms":{"type":"number","title":"P95 Latency Ms"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["bucket_date","avg_latency_ms","p50_latency_ms","p95_latency_ms","request_count"],"title":"LatencyTimeseriesPoint","description":"One bucket of aggregated response latency."},"LatencyTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/LatencyTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["points"],"title":"LatencyTimeseriesResponse","description":"Latency timeseries for charts."},"LeaderboardEntriesResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"dataset_id":{"type":"string","title":"Dataset Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"entries":{"items":{"$ref":"#/components/schemas/LeaderboardEntry"},"type":"array","title":"Entries"},"total_entries":{"type":"integer","title":"Total Entries"}},"type":"object","required":["dataset_id","dataset_name","entries","total_entries"],"title":"LeaderboardEntriesResponse","description":"Response containing leaderboard entries."},"LeaderboardEntry":{"properties":{"id":{"type":"string","title":"Id"},"dataset_id":{"type":"string","title":"Dataset Id"},"evaluation_id":{"type":"string","title":"Evaluation Id"},"user_id":{"type":"string","title":"User Id"},"display_name":{"type":"string","title":"Display Name"},"model_name":{"type":"string","title":"Model Name"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"f1_score":{"type":"number","title":"F1 Score"},"precision_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precision Score"},"recall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recall Score"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank"}},"type":"object","required":["id","dataset_id","evaluation_id","user_id","display_name","model_name","f1_score","created_at","updated_at"],"title":"LeaderboardEntry","description":"A single leaderboard entry."},"LeaderboardSubmission":{"properties":{"evaluation_id":{"type":"string","title":"Evaluation Id","description":"ID of the completed evaluation"},"display_name":{"type":"string","maxLength":50,"minLength":1,"title":"Display Name","description":"Display name for leaderboard"}},"type":"object","required":["evaluation_id","display_name"],"title":"LeaderboardSubmission","description":"Request to submit an evaluation to the leaderboard."},"LeaderboardSubmitResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"entry":{"$ref":"#/components/schemas/LeaderboardEntry"},"rank":{"type":"integer","title":"Rank"},"is_new_best":{"type":"boolean","title":"Is New Best","default":false}},"type":"object","required":["entry","rank"],"title":"LeaderboardSubmitResponse","description":"Response after submitting to leaderboard."},"LeaveTeamRequest":{"properties":{"transfer_plan":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object","title":"Transfer Plan"}},"type":"object","title":"LeaveTeamRequest","description":"Optional transfer plan accompanying a leave-team request.\n\nThe plan resolves every row the leaving user owns in the team:\ntransfer to another current member (any role) by user UUID, or\n``\"delete\"`` to remove the row inside the leave transaction.\nSole-member leaves omit the plan entirely.\n\nAttributes:\n    transfer_plan: ``{resource_type: {row_id: target_user_id|\"delete\"}}``.\n        Empty/absent when the user owns nothing or is the sole\n        member of the team."},"ListAPIKeysResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/APIKeyInfo"},"type":"array","title":"Keys"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["keys","count"],"title":"ListAPIKeysResponse","description":"Response model for listing API keys."},"ListBenchmarksResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"benchmarks":{"additionalProperties":{"items":{"$ref":"#/components/schemas/BenchmarkInfo"},"type":"array"},"type":"object","title":"Benchmarks"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","benchmarks","count"],"title":"ListBenchmarksResponse","description":"Response listing available benchmarks"},"MessageHistoryItem":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user' or 'assistant'"},"content":{"type":"string","minLength":1,"title":"Content","description":"Message content"}},"type":"object","required":["role","content"],"title":"MessageHistoryItem","description":"A single message in conversation history.\n\nArgs:\n    role: Message author role.\n    content: Message text content."},"ModelDatasetsResponse":{"properties":{"training_datasets":{"items":{"$ref":"#/components/schemas/TrainingDatasetRow"},"type":"array","title":"Training Datasets"},"evaluation_datasets":{"items":{"$ref":"#/components/schemas/EvaluationDatasetRow"},"type":"array","title":"Evaluation Datasets"}},"type":"object","title":"ModelDatasetsResponse","description":"Datasets scoped to either a project or a base model.\n\nTraining rows come from ``datasets.type = 'training'``; evaluation\nrows come from ``datasets.type IN ('evaluation', 'benchmark')`` and\ncarry their most recent completed evaluation against the model."},"ModelDownloadResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"job_id":{"type":"string","title":"Job Id"},"download_url":{"type":"string","title":"Download Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds","default":3600},"file_name":{"type":"string","title":"File Name"},"message":{"type":"string","title":"Message","default":"Download URL generated successfully"}},"type":"object","required":["success","job_id","download_url","file_name"],"title":"ModelDownloadResponse","description":"Response with presigned URL for model download"},"ModelLatencyTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date","description":"ISO date or datetime string"},"model":{"type":"string","title":"Model"},"avg_latency_ms":{"type":"number","title":"Avg Latency Ms"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["bucket_date","model","avg_latency_ms","request_count"],"title":"ModelLatencyTimeseriesPoint","description":"One bucket of per-model latency for charts."},"ModelLatencyTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/ModelLatencyTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["points"],"title":"ModelLatencyTimeseriesResponse","description":"Per-model latency timeseries for charts."},"ModelMetrics":{"properties":{"inference_count":{"type":"integer","title":"Inference Count","description":"Number of inference rows in the last 24 hours. For a training-job id associated with a project, counts every inference against any model in that project (scoped by project_id). For orphan training jobs, counts by training_job_id. For base catalog ids, counts direct-base calls where model_id matches.","default":0},"error_count":{"type":"integer","title":"Error Count","description":"Inferences in the last 24 hours with status = 'failed'.","default":0},"avg_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Latency Ms","description":"Average latency over the last 24 hours, or null when no latency was recorded."},"last_inference_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Inference At","description":"Most recent inference ``created_at`` observed in the last 24 hours, or null."},"latest_evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationSummary"},{"type":"null"}],"description":"Most recent evaluation for this model id (all-time, status='complete')."},"inference_count_prev_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inference Count Prev 24H","description":"Inference count for the 24h window immediately before the current window (i.e. 48h ago to 24h ago). Used to compute the trend arrow on the KPI grid. Scoped to the requesting team."},"inference_count_all_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inference Count All Time","description":"All-time inference count with no time window, scoped to the requesting team. Shown as the caption below the 24h count on the monitoring KPI grid."},"p99_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Latency Ms","description":"p99 latency in milliseconds over the last 24 hours. Distinct from ``avg_latency_ms``. Computed via Postgres ``percentile_cont(0.99) WITHIN GROUP (ORDER BY latency_ms)`` over the team's inferences."},"median_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Latency Ms","description":"Median (p50) latency in milliseconds over the last 24 hours. Shown as the caption below p99 on the monitoring KPI grid."},"p99_latency_ms_prev_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Latency Ms Prev 24H","description":"p99 latency for the prior 24h window. Used for the latency trend arrow on the KPI grid."},"spend_24h_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend 24H Usd","description":"Estimated spend in USD attributed to this model in the last 24 hours. Computed as SUM(inferences.tokens) x input_price_per_million / 1_000_000 via the ``pricing.resolver`` lookup. Returns null when pricing is unavailable for the resolved model."},"spend_prev_24h_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend Prev 24H Usd","description":"Spend for the prior 24h window. Used for the spend trend arrow."},"spend_per_1k_calls_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend Per 1K Calls Usd","description":"Average cost per 1,000 inferences over the last 24 hours. Shown as the secondary caption on the Spend / 24h KPI cell. Null when ``spend_24h_usd`` is null or there are no inferences in the window."},"open_issue_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Open Issue Count","description":"Count of inferences in the last 24h where ``llmaj_verdict = 'incorrect'`` OR ``human_verdict = 'incorrect'``. Shown as the footer on the task model 'Inferences / 24hrs' stat card."}},"type":"object","title":"ModelMetrics","description":"Per-model metrics shown on the Models page and overview surfaces.\n\nCounts and latency are computed over the **last 24 hours** of\n``public.inferences`` rows. ``latest_evaluation`` is all-time and may\nbe ``None`` when the model has never been evaluated.\n\nAll counts and aggregates are **scoped to the requesting team** via the\nRLS-applied ``get_session()`` path — these are not cross-tenant fleet\nmetrics for base catalog ids."},"ModelMetricsRequest":{"properties":{"model_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":0,"title":"Model Ids","description":"Model identifiers to compute metrics for. Accepts training-job UUIDs and base catalog ids."}},"type":"object","required":["model_ids"],"title":"ModelMetricsRequest","description":"Batch request body for model metrics lookup."},"ModelMetricsResponse":{"properties":{"metrics":{"additionalProperties":{"$ref":"#/components/schemas/ModelMetrics"},"type":"object","title":"Metrics"}},"type":"object","title":"ModelMetricsResponse","description":"Batch response mapping input model id -> ModelMetrics.\n\nEvery requested id is present in ``metrics``; ids with no matching\ninference rows in the last 24 hours map to a zero-filled ``ModelMetrics``."},"ModelUsageTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date","description":"ISO date or datetime string"},"model":{"type":"string","title":"Model"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["bucket_date","model","request_count"],"title":"ModelUsageTimeseriesPoint","description":"One bucket of per-model usage for stacked bar charts."},"ModelUsageTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/ModelUsageTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["points"],"title":"ModelUsageTimeseriesResponse","description":"Per-model usage series for stacked bar charts."},"ModelWithEvaluation":{"properties":{"model_id":{"type":"string","title":"Model Id"},"model_name":{"type":"string","title":"Model Name"},"is_base_model":{"type":"boolean","title":"Is Base Model","default":false},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResponse"},{"type":"null"}]}},"type":"object","required":["model_id","model_name"],"title":"ModelWithEvaluation","description":"A model with its evaluation result for a specific dataset"},"ModificationSummary":{"properties":{"duplicates_removed":{"type":"integer","title":"Duplicates Removed","default":0},"outliers_removed":{"type":"integer","title":"Outliers Removed","default":0},"samples_generated":{"type":"integer","title":"Samples Generated","default":0},"original_count":{"type":"integer","title":"Original Count","default":0},"final_count":{"type":"integer","title":"Final Count","default":0}},"type":"object","title":"ModificationSummary","description":"Summary of modifications applied during augmentation."},"MultiplicatorRequest":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"Multiplicator prompt (e.g., 'The sentiment should be')"},"choices":{"items":{"type":"string"},"type":"array","title":"Choices","description":"List of choices to balance across"}},"type":"object","required":["prompt","choices"],"title":"MultiplicatorRequest","description":"Multiplicator for balanced dataset distribution"},"NERClassifiedExample":{"properties":{"text":{"type":"string","title":"Text","description":"Example text"},"entities":{"items":{"prefixItems":[{"type":"string"},{"type":"string"}],"type":"array","maxItems":2,"minItems":2},"type":"array","title":"Entities","description":"List of (entity_text, entity_type) tuples"},"feedback":{"anyOf":[{"type":"string","enum":["positive","negative"]},{"type":"null"}],"title":"Feedback","description":"User feedback: positive (upvote) or negative (downvote)"}},"type":"object","required":["text","entities"],"title":"NERClassifiedExample","description":"NER example with optional user feedback for improving generation."},"OutlierSample":{"properties":{"index":{"type":"integer","title":"Index"},"value":{"type":"number","title":"Value"},"z_score":{"type":"number","title":"Z Score"},"type":{"type":"string","title":"Type"},"sample":{"additionalProperties":true,"type":"object","title":"Sample"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint","description":"Content-based SHA-256 fingerprint for stable identification"}},"type":"object","required":["index","value","z_score","type","sample"],"title":"OutlierSample"},"OutlierThresholds":{"properties":{"mean_length":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Length"},"upper_bound_length":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Upper Bound Length"},"lower_bound_length":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lower Bound Length"}},"type":"object","title":"OutlierThresholds"},"OutliersAnalysis":{"properties":{"outlier_count":{"type":"integer","title":"Outlier Count"},"thresholds":{"$ref":"#/components/schemas/OutlierThresholds"},"samples":{"items":{"$ref":"#/components/schemas/OutlierSample"},"type":"array","title":"Samples"}},"type":"object","required":["outlier_count","thresholds","samples"],"title":"OutliersAnalysis"},"OverageSettingsResponse":{"properties":{"overage_enabled":{"type":"boolean","title":"Overage Enabled"},"topup_amount":{"type":"number","title":"Topup Amount","description":"Credits added per top-up charge (1 credit = $0.01)"},"topup_mode":{"type":"string","title":"Topup Mode","description":"Top-up mode: 'by' adds a fixed amount, 'to' restores balance to topup_amount","default":"by"},"charge_threshold":{"type":"number","title":"Charge Threshold","description":"Trigger charge when remaining credits drop below this"},"max_monthly_spend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Monthly Spend","description":"Monthly overage cap in credits (null = unlimited)"},"current_month_charged":{"type":"number","title":"Current Month Charged","description":"Credits charged via overages this month"},"current_month_start":{"type":"string","title":"Current Month Start","description":"ISO timestamp of current billing month start"},"credit_limit":{"type":"number","title":"Credit Limit","description":"Plan's included credit allowance per period"},"current_period_usage":{"type":"number","title":"Current Period Usage","description":"Credits consumed in current billing period"},"current_period_requests":{"type":"integer","title":"Current Period Requests","description":"Number of inference requests in current billing period","default":0},"max_overage_hard_cap":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Overage Hard Cap","description":"Platform hard cap on daily overage spend in credits (null = no platform cap)"},"paid_credit_balance":{"type":"number","title":"Paid Credit Balance","description":"Persistent paid credit wallet balance (carries over indefinitely)","default":0},"usage_reset_hour":{"type":"integer","title":"Usage Reset Hour","description":"Local hour when daily credits reset. 0-23 in usage_reset_timezone.","default":0},"usage_reset_timezone":{"type":"string","title":"Usage Reset Timezone","description":"IANA timezone used to interpret usage_reset_hour.","default":"UTC"},"usage_reset_hour_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Reset Hour Changed At","description":"ISO timestamp of last reset-hour change. Null if never changed."}},"type":"object","required":["overage_enabled","topup_amount","charge_threshold","max_monthly_spend","current_month_charged","current_month_start","credit_limit","current_period_usage"],"title":"OverageSettingsResponse","description":"Current overage billing settings for a team."},"OwnedResourceItem":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"}},"type":"object","required":["id","label"],"title":"OwnedResourceItem","description":"One row the leaving user owns in a team."},"OwnedResourcesResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"is_sole_member":{"type":"boolean","title":"Is Sole Member"},"owned":{"additionalProperties":{"items":{"$ref":"#/components/schemas/OwnedResourceItem"},"type":"array"},"type":"object","title":"Owned"}},"type":"object","required":["is_sole_member","owned"],"title":"OwnedResourcesResponse","description":"Response for ``GET /teams/{team_id}/owned-resources``.\n\nEach key in ``owned`` is a stable resource-type identifier\n(``projects``, ``datasets``, ``training_jobs``, ``model_evaluations``,\n``agent_runs``). Resource types with zero owned rows are omitted\nso the frontend can render an empty-state card directly when\n``len(owned) == 0`` (and also includes ``is_sole_member`` so the\nUI can route to the destructive sole-member-leave flow without a\nsecond round-trip)."},"PIIFinding":{"properties":{"row_index":{"type":"integer","title":"Row Index"},"column":{"type":"string","title":"Column"},"entity_type":{"type":"string","title":"Entity Type"},"text":{"type":"string","title":"Text"},"start":{"type":"integer","title":"Start"},"end":{"type":"integer","title":"End"},"score":{"type":"number","title":"Score"}},"type":"object","required":["row_index","column","entity_type","text","start","end","score"],"title":"PIIFinding","description":"A single PII finding"},"PaymentMethodInfo":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"card"},"brand":{"type":"string","title":"Brand"},"last4":{"type":"string","title":"Last4"},"exp_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp Month"},"exp_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp Year"}},"type":"object","required":["id","brand","last4"],"title":"PaymentMethodInfo","description":"Information about a payment method.\n\n``brand`` and ``last4`` are always populated with a display-ready value\n(for non-card types like Link or bank accounts, the brand is the\nprovider name and ``last4`` may be an empty string). ``exp_month`` and\n``exp_year`` are only present for card-backed payment methods."},"PendingInvitationsResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"invitations":{"items":{"$ref":"#/components/schemas/TeamInvitationResponse"},"type":"array","title":"Invitations"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["invitations","count"],"title":"PendingInvitationsResponse","description":"Response model for pending invitations for the current user."},"PioneerExtension":{"properties":{"inference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inference Id"}},"type":"object","title":"PioneerExtension","description":"Pioneer-specific extension fields appended to OpenAI-compatible responses.\n\nOpenAI's API contract reserves the unprefixed top-level keys (``id``,\n``choices``, ``usage``, …); custom data must live under a clearly\nnamespaced key. ``x_pioneer`` is that key.\n\nAttributes:\n    inference_id: The Pioneer-side identifier of the persisted\n        ``inferences`` row associated with this completion. Present\n        when persistence is enabled (``extra_body.store == True``)\n        and the row was successfully recorded; ``None`` for ad-hoc\n        requests that opted out of persistence. The frontend uses\n        this to poll ``GET /inferences/{id}`` for asynchronous\n        judge results without coupling the inference response\n        latency to the judge."},"PlanInfoResponse":{"properties":{"payment_plan":{"type":"string","title":"Payment Plan"},"credit_limit":{"type":"number","title":"Credit Limit"},"user_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Limit"},"total_usage":{"type":"number","title":"Total Usage"},"remaining_credits":{"type":"number","title":"Remaining Credits"},"exceeds_limit":{"type":"boolean","title":"Exceeds Limit"}},"type":"object","required":["payment_plan","credit_limit","user_limit","total_usage","remaining_credits","exceeds_limit"],"title":"PlanInfoResponse","description":"Response model for plan information."},"PresetDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"task_type":{"type":"string","title":"Task Type"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]}},"type":"object","required":["id","name","description","task_type","config"],"title":"PresetDetail","description":"Preset detail with full configuration"},"PresetMetadata":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"task_type":{"type":"string","title":"Task Type"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]}},"type":"object","required":["id","name","description","task_type"],"title":"PresetMetadata","description":"Preset metadata"},"ProjectCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Name for the project"},"icon":{"type":"string","maxLength":50,"title":"Icon","description":"Icon identifier for the project","default":"folder"},"repo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Repo","description":"Optional repository reference or URL"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Optional project description"},"active_model_id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Active Model Id","description":"Active model ID for inference"},"selected_model_id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Selected Model Id","description":"[Deprecated] Use active_model_id instead."},"tag":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Tag","description":"Short kebab-case label set by clustering agent"},"observations":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Observations","description":"Free-text agent notes about patterns observed"},"example":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Example","description":"Generated API example for the project"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id","description":"Team ID to assign this project to. Defaults to the user's personal team when omitted."},"visibility":{"type":"string","enum":["private","team"],"title":"Visibility","description":"Who can see this project: private (creator only) or team (all team members).","default":"private"},"adaptive_cadence":{"$ref":"#/components/schemas/AdaptiveCadence","description":"How often the autonomous adaptive finetuning agent runs for this project (off / daily / weekly / monthly). Only consulted when autonomy_enabled is true. Defaults to weekly.","default":"weekly"},"router_type":{"anyOf":[{"$ref":"#/components/schemas/RouterType"},{"type":"null"}],"description":"When set, makes this project a router that selects a model per request."},"routing_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Routing Params","description":"Router policy configuration; validated against the router_type schema."}},"type":"object","required":["name"],"title":"ProjectCreate","description":"Request model for creating a project."},"ProjectDatasetCountResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"dataset_count":{"type":"integer","title":"Dataset Count"},"can_delete":{"type":"boolean","title":"Can Delete"}},"type":"object","required":["project_id","dataset_count","can_delete"],"title":"ProjectDatasetCountResponse","description":"Response model for getting dataset count for a project."},"ProjectDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"project_id":{"type":"string","title":"Project Id"}},"type":"object","required":["success","message","project_id"],"title":"ProjectDeleteResponse","description":"Response model for deleting a project."},"ProjectInferenceClusterSummary":{"properties":{"active_cluster_count":{"type":"integer","title":"Active Cluster Count","default":0},"open_count":{"type":"integer","title":"Open Count","default":0},"reopened_count":{"type":"integer","title":"Reopened Count","default":0},"not_pass_count":{"type":"integer","title":"Not Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0},"uncertain_count":{"type":"integer","title":"Uncertain Count","default":0}},"type":"object","title":"ProjectInferenceClusterSummary","description":"Project-level cluster summary for the selected window.\n\nAttributes:\n    active_cluster_count: Number of active clusters returned.\n    open_count: Number of open clusters.\n    reopened_count: Number of reopened clusters.\n    not_pass_count: Total fail or uncertain member count.\n    fail_count: Total fail count.\n    uncertain_count: Total uncertain count."},"ProjectInferenceClustersResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"window":{"type":"string","enum":["24h","7d","30d","all"],"title":"Window"},"summary":{"$ref":"#/components/schemas/ProjectInferenceClusterSummary"},"base_models":{"items":{"$ref":"#/components/schemas/InferenceClusterBaseModelGroup"},"type":"array","title":"Base Models"},"usage_aware_clustering_enabled":{"type":"boolean","title":"Usage Aware Clustering Enabled","default":false},"usage_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Summary"},"usage_drift_detected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Usage Drift Detected"},"suggested_project_split":{"type":"boolean","title":"Suggested Project Split","default":false},"split_rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Split Rationale"}},"type":"object","required":["project_id","window","summary"],"title":"ProjectInferenceClustersResponse","description":"Response for listing all project inference clusters.\n\nAttributes:\n    project_id: Project ID.\n    window: Metrics window used for ranking and counts.\n    summary: Project-level cluster summary.\n    base_models: Clusters grouped by base model and variant."},"ProjectListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"projects":{"items":{"$ref":"#/components/schemas/ProjectResponse"},"type":"array","title":"Projects"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["projects","count"],"title":"ProjectListResponse","description":"Response model for listing projects."},"ProjectResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"icon":{"type":"string","title":"Icon","default":"folder"},"repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Model Id"},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"},"observations":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observations"},"example":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Example"},"team_id":{"type":"string","title":"Team Id"},"visibility":{"type":"string","title":"Visibility","default":"private"},"adaptive_cadence":{"$ref":"#/components/schemas/AdaptiveCadence","default":"weekly"},"autonomy_enabled":{"type":"boolean","title":"Autonomy Enabled","default":true},"router_type":{"anyOf":[{"$ref":"#/components/schemas/RouterType"},{"type":"null"}]},"routing_params":{"additionalProperties":true,"type":"object","title":"Routing Params"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"selected_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Model Id","description":"Deprecated alias for active_model_id -- kept for backward compat.","readOnly":true}},"type":"object","required":["id","user_id","name","team_id","created_at","updated_at","selected_model_id"],"title":"ProjectResponse","description":"Response model for a single project."},"ProjectUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"New name for the project"},"icon":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Icon","description":"New icon identifier for the project"},"repo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Repo","description":"New repository reference or URL"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"New project description"},"tag":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Tag","description":"Short kebab-case label set by clustering agent"},"observations":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Observations","description":"Free-text agent notes about patterns observed"},"active_model_id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Active Model Id","description":"Active model ID for inference"},"selected_model_id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Selected Model Id","description":"[Deprecated] Use active_model_id instead."},"visibility":{"anyOf":[{"type":"string","enum":["private","team"]},{"type":"null"}],"title":"Visibility","description":"Who can see this project: private (creator only) or team (all team members)."},"adaptive_cadence":{"anyOf":[{"$ref":"#/components/schemas/AdaptiveCadence"},{"type":"null"}],"description":"How often the autonomous adaptive finetuning agent runs for this project (off / daily / weekly / monthly). Only consulted when autonomy_enabled is true."},"autonomy_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Autonomy Enabled","description":"Whether autonomous LLMAJ, clustering, and adaptation are enabled for this project."},"router_type":{"anyOf":[{"$ref":"#/components/schemas/RouterType"},{"type":"null"}],"description":"When set, makes this project a router that selects a model per request."},"routing_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Routing Params","description":"Router policy configuration; validated against the router_type schema."}},"type":"object","title":"ProjectUpdate","description":"Request model for updating a project."},"PromptTokensDetails":{"properties":{"cached_tokens":{"type":"integer","title":"Cached Tokens","default":0},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens","default":0}},"type":"object","title":"PromptTokensDetails","description":"Per-input-class breakdown for OpenAI-shape usage payloads.\n\nMirrors OpenAI's ``prompt_tokens_details`` block and OpenRouter's\ncache-creation extension so clients reading\n``usage.prompt_tokens_details.cached_tokens`` /\n``cache_write_tokens`` keep working when Pioneer relays a cache-aware\nupstream response. Both counts are subsets of ``prompt_tokens`` on the\nwire — that's the upstream contract Pioneer relays faithfully.\n\nAttributes:\n    cached_tokens: Input tokens served from the upstream prompt cache\n        (cache read).\n    cache_write_tokens: Input tokens written into the upstream prompt\n        cache (cache creation). ``0`` for upstreams that bill writes\n        as plain input (OpenAI, Fireworks, vLLM)."},"PublicCheckoutRequest":{"properties":{"plan":{"type":"string","enum":["pro","research"],"title":"Plan","description":"Target plan to subscribe to"},"success_url":{"type":"string","title":"Success Url","description":"URL to redirect to after successful payment"},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL to redirect to if user cancels"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Email address to pre-fill in Stripe checkout"},"captcha_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captcha Token","description":"hCaptcha response token for bot verification"}},"type":"object","required":["plan","success_url","cancel_url"],"title":"PublicCheckoutRequest","description":"Request for unauthenticated checkout via a shareable link."},"PublicCheckoutResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"PublicCheckoutResponse","description":"Response from the unauthenticated checkout endpoint."},"PurchaseCreditsRequest":{"properties":{"amount_usd":{"type":"number","maximum":500.0,"exclusiveMinimum":0.0,"title":"Amount Usd","description":"Amount in USD to purchase (max $500 per transaction)"}},"type":"object","required":["amount_usd"],"title":"PurchaseCreditsRequest","description":"Request to purchase credits directly."},"PurchaseCreditsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"credits_added":{"type":"number","title":"Credits Added","description":"Credits added to paid balance"},"new_paid_balance":{"type":"number","title":"New Paid Balance","description":"Updated paid credit balance"},"amount_charged_cents":{"type":"integer","title":"Amount Charged Cents","description":"Amount charged in cents"}},"type":"object","required":["success","credits_added","new_paid_balance","amount_charged_cents"],"title":"PurchaseCreditsResponse","description":"Response after purchasing credits."},"PushDatasetToHubResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"url":{"type":"string","title":"Url"},"repo_id":{"type":"string","title":"Repo Id"},"version":{"type":"string","title":"Version"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","url","repo_id","version","message"],"title":"PushDatasetToHubResponse","description":"Response model for pushing dataset to HuggingFace Hub"},"PushModelToHubResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"url":{"type":"string","title":"Url"},"repo_id":{"type":"string","title":"Repo Id"},"job_id":{"type":"string","title":"Job Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","url","repo_id","job_id","message"],"title":"PushModelToHubResponse","description":"Response model for pushing model to HuggingFace Hub"},"QualityMetricsResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"pass_count":{"type":"integer","title":"Pass Count","description":"Inferences with llmaj_verdict='pass'.","default":0},"fail_count":{"type":"integer","title":"Fail Count","description":"Inferences with llmaj_verdict='fail'.","default":0},"uncertain_count":{"type":"integer","title":"Uncertain Count","description":"Inferences with llmaj_verdict='uncertain'.","default":0},"total_judged":{"type":"integer","title":"Total Judged","description":"Total inferences with any llmaj_verdict.","default":0},"pass_rate":{"type":"number","title":"Pass Rate","description":"Pass count / total judged.","default":0.0},"fail_rate":{"type":"number","title":"Fail Rate","description":"Fail count / total judged.","default":0.0}},"type":"object","required":["project_id"],"title":"QualityMetricsResponse","description":"LLMAJ quality metrics aggregation for a project."},"QualityTimeSeriesBucket":{"properties":{"ts":{"type":"string","format":"date-time","title":"Ts","description":"Bucket start (date_trunc'd) in UTC."},"llmaj_score_avg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llmaj Score Avg","description":"Average ``llmaj_score`` over inferences in this bucket. Null when no inference in the bucket has a score."},"llmaj_correct_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llmaj Correct Pct","description":"Fraction of judged inferences in this bucket where ``llmaj_verdict = 'pass'``. Null when no inference in the bucket has a verdict."},"sample_count":{"type":"integer","title":"Sample Count","description":"Number of inferences in this bucket with a non-null ``llmaj_score``.","default":0}},"type":"object","required":["ts"],"title":"QualityTimeSeriesBucket","description":"A single time-bucket sample of LLMAJ-derived quality metrics.\n\nComputed from ``public.inferences`` rows whose ``llmaj_verdict`` /\n``llmaj_score`` columns are populated by the asynchronous LLM-as-Judge\npipeline (see ``brain/services/data_engine/llmaj/handler.py``)."},"QualityTimeSeriesResponse":{"properties":{"model_id":{"type":"string","title":"Model Id","description":"Echo of the requested model id."},"interval":{"type":"string","enum":["day","week"],"title":"Interval","description":"``date_trunc`` bucket size used for the aggregation."},"since":{"type":"string","format":"date-time","title":"Since","description":"Inclusive start of the window (UTC)."},"until":{"type":"string","format":"date-time","title":"Until","description":"Exclusive end of the window (UTC)."},"series":{"items":{"$ref":"#/components/schemas/QualityTimeSeriesBucket"},"type":"array","title":"Series","description":"Buckets ordered by ``ts`` descending."}},"type":"object","required":["model_id","interval","since","until"],"title":"QualityTimeSeriesResponse","description":"Bucketed LLMAJ quality timeseries for a single model scope.\n\nReturns LLM-as-Judge pass-rate and score buckets for the requested\n``model_id`` over the requested window. Buckets are ordered by\n``ts`` descending. Empty windows return ``series=[]`` rather than 404.\n\nNo cross-model \"vs base\" comparison is provided. The codebase has no\npaired-evaluation pipeline, so a meaningful task-vs-base comparison\ncannot be derived from existing ``inferences`` data alone."},"RLConfig":{"properties":{"max_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Steps"},"kl_beta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Kl Beta"},"group_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Size"},"sampling_temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sampling Temperature"},"max_completion_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Completion Length"},"logging_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logging Steps"},"dpo_beta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dpo Beta"},"loss_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loss Type"},"reward_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reward Type"},"extras":{"additionalProperties":true,"type":"object","title":"Extras"}},"type":"object","title":"RLConfig"},"ReasoningRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Whether reasoning is enabled. Set to false to explicitly turn thinking off on models that have it on by default (Anthropic `thinking={\"type\": \"disabled\"}`, Fireworks `reasoning_effort=\"none\"`).","default":true},"effort":{"anyOf":[{"type":"string","enum":["minimal","low","medium","high","xhigh","none"]},{"type":"null"}],"title":"Effort","description":"OpenAI/Grok-style reasoning effort tier (minimal/low/medium/high/xhigh, or 'none' to disable). Honored natively by OpenAI, Fireworks, Grok; translated into `budget_tokens` for Anthropic manual mode or into `effort` for Anthropic adaptive mode. Mutually exclusive with `max_tokens`."},"max_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"Anthropic-style reasoning budget in tokens. Honored natively by Anthropic / Bedrock manual mode (`thinking.budget_tokens`) and by OpenRouter; ignored by OpenAI/Fireworks. On models that require adaptive mode (Opus 4.7+), Pioneer translates this into the nearest `effort` tier instead of returning a 400. Mutually exclusive with `effort`."},"mode":{"anyOf":[{"type":"string","enum":["manual","adaptive"]},{"type":"null"}],"title":"Mode","description":"Anthropic extended-thinking dispatch mode (manual/adaptive). Anthropic-specific; ignored on other providers. Leave unset to let Pioneer pick the per-model default and auto-upgrade where the model requires adaptive."},"display":{"anyOf":[{"type":"string","enum":["summarized","omitted"]},{"type":"null"}],"title":"Display","description":"Anthropic extended-thinking response display control (summarized/omitted). Anthropic-specific; ignored on other providers. `omitted` skips thinking-text streaming for faster time-to-first-text; signature is still preserved for multi-turn continuity. Valid only when `enabled=true`."},"exclude":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exclude","description":"When true, the model still reasons internally but reasoning tokens are not returned to the caller. Honored by OpenRouter; ignored by providers that do not surface a reasoning response channel.","default":false}},"additionalProperties":false,"type":"object","title":"ReasoningRequest","description":"Opt-in reasoning / extended-thinking controls for decoder requests.\n\nSingle typed surface for every reasoning-capable upstream. Pioneer\nnormalizes this object into the canonical ``ReasoningConfig`` slot at\nthe adapter boundary and each provider renders its native wire field:\n\n* Anthropic / Bedrock — ``thinking={\"type\":\"enabled\",\"budget_tokens\":N}``\n  or ``thinking={\"type\":\"adaptive\",\"effort\":tier}`` (with optional\n  ``display``). The renderer auto-upgrades manual configs to adaptive\n  on models that require it (Opus 4.7+ / Mythos).\n* OpenAI direct / Fireworks / Modal vLLM — top-level\n  ``reasoning_effort`` tier (effort only; no per-call budget).\n* OpenRouter — normalized ``reasoning`` object preserving every field.\n\nPioneer does not enable reasoning by default. Sending this object is\nopt-in; omit it for the model's default behavior."},"RecordField":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","default":"str"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allowed_values":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Values"}},"type":"object","required":["name"],"title":"RecordField","description":"Record field definition"},"RemovePaymentMethodRequest":{"properties":{"payment_method_id":{"type":"string","title":"Payment Method Id","description":"Stripe payment method ID to remove"}},"type":"object","required":["payment_method_id"],"title":"RemovePaymentMethodRequest","description":"Request model for removing a payment method."},"RemoveTeamPaymentMethodRequest":{"properties":{"payment_method_id":{"type":"string","title":"Payment Method Id","description":"Stripe payment method ID to remove"}},"type":"object","required":["payment_method_id"],"title":"RemoveTeamPaymentMethodRequest","description":"Request model for removing a team payment method."},"ResponsesReasoningRequest":{"properties":{"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort","description":"Optional reasoning effort hint, such as 'low', 'medium', or 'high'."},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Optional Responses-style reasoning summary mode."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"OpenRouter-style switch for enabling reasoning on capable models."},"exclude":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exclude","description":"When supported by the upstream provider, exclude reasoning text from the response while still allowing the model to use reasoning."}},"additionalProperties":true,"type":"object","title":"ResponsesReasoningRequest","description":"Opt-in reasoning controls in OpenAI Responses format."},"ResponsesRequest":{"properties":{"model":{"type":"string","title":"Model"},"instructions":{"type":"string","title":"Instructions","default":""},"input":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"}],"title":"Input"},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tools"},"tool_choice":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}],"title":"Tool Choice","default":"auto"},"parallel_tool_calls":{"type":"boolean","title":"Parallel Tool Calls","default":false},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ResponsesReasoningRequest"},{"type":"null"}]},"store":{"type":"boolean","title":"Store","default":true},"stream":{"type":"boolean","title":"Stream","default":false},"include":{"items":{"type":"string"},"type":"array","title":"Include"},"service_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Tier"},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key"},"text":{"anyOf":[{"$ref":"#/components/schemas/ResponsesTextRequest"},{"type":"null"}]},"max_output_tokens":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Output Tokens"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"extra_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Extra Headers"},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body"},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"**Deprecated.** Legacy task hint (``extract_entities`` / ``classify_text`` / ``extract_json`` / ``ner`` / ``schema``). The unified schema on ``text.format.schema`` disambiguates the task automatically. Submitting this field emits ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers on the response."},"include_confidence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Confidence","default":true},"include_spans":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Spans","default":true}},"additionalProperties":true,"type":"object","required":["model"],"title":"ResponsesRequest","description":"OpenAI-compatible Responses API request.\n\n``input`` accepts either a plain string (convenience shorthand used by the\nOpenAI SDK for simple text prompts) or a list of input items."},"ResponsesTextFormatRequest":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"strict":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Strict"},"schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"additionalProperties":true,"type":"object","title":"ResponsesTextFormatRequest","description":"Structured-output controls for Responses text formatting."},"ResponsesTextRequest":{"properties":{"verbosity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verbosity"},"format":{"anyOf":[{"$ref":"#/components/schemas/ResponsesTextFormatRequest"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"ResponsesTextRequest","description":"Responses text controls."},"RoutedSavingsItem":{"properties":{"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Router project UUID; None for the overall rollup row"},"routed_request_count":{"type":"integer","title":"Routed Request Count","default":0},"fallback_count":{"type":"integer","title":"Fallback Count","default":0},"expected_cost_usd":{"type":"number","title":"Expected Cost Usd","default":0.0},"most_expensive_cost_usd":{"type":"number","title":"Most Expensive Cost Usd","default":0.0},"savings_usd":{"type":"number","title":"Savings Usd","default":0.0},"savings_ratio":{"type":"number","title":"Savings Ratio","description":"savings_usd / most_expensive_cost_usd, 0 when no baseline","default":0.0}},"type":"object","title":"RoutedSavingsItem","description":"Routed-savings rollup for one project (or the overall total).\n\nCosts are the router's expected-cost basis recorded per inference, where\n``savings_usd`` is the benefit of the chosen model relative to the most\nexpensive candidate the router considered — not a billed-dollar figure."},"RoutedSavingsResponse":{"properties":{"overall":{"$ref":"#/components/schemas/RoutedSavingsItem"},"per_project":{"items":{"$ref":"#/components/schemas/RoutedSavingsItem"},"type":"array","title":"Per Project"}},"type":"object","required":["overall","per_project"],"title":"RoutedSavingsResponse","description":"Routed-savings report: overall rollup plus a per-project breakdown."},"RoutedSavingsTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date"},"routed_cost_usd":{"type":"number","title":"Routed Cost Usd","default":0.0},"baseline_cost_usd":{"type":"number","title":"Baseline Cost Usd","default":0.0},"savings_usd":{"type":"number","title":"Savings Usd","default":0.0},"routed_request_count":{"type":"integer","title":"Routed Request Count","default":0}},"type":"object","required":["bucket_date"],"title":"RoutedSavingsTimeseriesPoint","description":"One time-bucketed row from the routed-savings timeseries."},"RoutedSavingsTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/RoutedSavingsTimeseriesPoint"},"type":"array","title":"Points"},"router_on":{"type":"boolean","title":"Router On","default":true}},"type":"object","required":["points"],"title":"RoutedSavingsTimeseriesResponse","description":"Timeseries of router savings bucketed by day.\n\n``router_on`` reports whether routing is live for the caller's team. When\ntrue the points are realized savings stamped on routed inferences (blue,\n\"actual\"). When false the points are an *estimate* of what the router could\nhave saved, derived from the user's real billed spend repriced against a\nreference model (orange, \"estimated\")."},"RouterType":{"type":"string","enum":["code"],"title":"RouterType","description":"Kind of model router a project runs.\n\n``NULL`` on ``projects.router_type`` is the canonical ordinary-project\nstate; a concrete value marks the project as a router that selects a\nmodel per request. ``code`` is the trained code-router (EXT-1 adds more)."},"RowUpdate":{"properties":{"row_index":{"type":"integer","title":"Row Index","description":"Zero-based index of the row to update"},"changes":{"additionalProperties":true,"type":"object","title":"Changes","description":"Column name to new value mapping"}},"type":"object","required":["row_index","changes"],"title":"RowUpdate","description":"A single row update specification."},"SeatChangePreview":{"properties":{"current_seats":{"type":"integer","title":"Current Seats","description":"Current number of seats"},"new_seats":{"type":"integer","title":"New Seats","description":"Seat count after the change"},"unit_price":{"type":"integer","title":"Unit Price","description":"Price per seat in whole dollars"},"interval":{"type":"string","title":"Interval","description":"Billing interval: 'month' or 'year'"},"new_total":{"type":"integer","title":"New Total","description":"New total cost per interval in whole dollars"},"proration_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Proration Amount","description":"Estimated proration charge in whole dollars, if available"}},"type":"object","required":["current_seats","new_seats","unit_price","interval","new_total"],"title":"SeatChangePreview","description":"Preview of a seat-count change before it is applied."},"SetActiveTeamRequest":{"properties":{"team_id":{"type":"string","format":"uuid","title":"Team Id"}},"type":"object","required":["team_id"],"title":"SetActiveTeamRequest","description":"Request body for POST /users/me/active-team."},"SetupPaymentMethodRequest":{"properties":{"payment_method_id":{"type":"string","title":"Payment Method Id","description":"Stripe payment method ID from Stripe.js"},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id","description":"Set only on the post-3DS retry to finalize the existing verification PaymentIntent. Must match the ``payment_intent_id`` returned in the previous ``requires_action`` response."}},"type":"object","required":["payment_method_id"],"title":"SetupPaymentMethodRequest","description":"Request model for setting up a payment method.\n\nOn the initial attempt the frontend sends only ``payment_method_id`` and\nthe backend creates a $1 pre-auth PaymentIntent to verify the card. If\nthe issuer requires SCA the response carries ``requires_action=True``\nand a ``client_secret`` / ``payment_intent_id`` pair. The frontend then\ndrives the 3DS challenge via ``stripe.handleNextAction`` and re-calls\nthis endpoint with BOTH ``payment_method_id`` AND ``payment_intent_id``;\nthe backend retrieves and finalizes that existing PI (rather than\ncreating a new one) so we read the post-3DS state instead of Stripe's\nidempotent replay of the original ``requires_action`` body."},"SetupPaymentMethodResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"requires_action":{"type":"boolean","title":"Requires Action","default":false},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id"}},"type":"object","required":["success","message"],"title":"SetupPaymentMethodResponse","description":"Response model for payment method setup.\n\nWhen the issuer requires SCA / 3DS on the verification PaymentIntent\nthe response sets ``requires_action=True`` and ships ``client_secret``\nso the frontend can complete the 3DS challenge via\n``stripe.handleNextAction`` and re-invoke the same endpoint. The\nbackend re-creates the PaymentIntent with the same idempotency key,\nStripe returns the same (now-confirmed) intent, and we finalize."},"SetupTeamPaymentMethodRequest":{"properties":{"payment_method_id":{"type":"string","title":"Payment Method Id","description":"Stripe payment method ID from Stripe.js"},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id","description":"Set only on the post-3DS retry to finalize the existing verification PaymentIntent. Must match the ``payment_intent_id`` returned in the previous ``requires_action`` response."}},"type":"object","required":["payment_method_id"],"title":"SetupTeamPaymentMethodRequest","description":"Request model for setting up a team payment method.\n\nSee ``SetupPaymentMethodRequest`` for the two-call SCA protocol."},"SpanFrequency":{"properties":{"text":{"type":"string","title":"Text"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["text","count"],"title":"SpanFrequency"},"SplitRatio":{"properties":{"train":{"type":"number","title":"Train"},"val":{"type":"number","title":"Val"}},"type":"object","required":["train","val"],"title":"SplitRatio"},"SplitRatioConfig":{"properties":{"training":{"type":"number","maximum":0.95,"minimum":0.05,"title":"Training","description":"Fraction of data for training (0.05–0.95)","default":0.8},"evaluation":{"type":"number","maximum":0.95,"minimum":0.05,"title":"Evaluation","description":"Fraction of data for evaluation (0.05–0.95)","default":0.2}},"type":"object","title":"SplitRatioConfig","description":"Split ratio configuration for train/eval split datasets.\n\nValues are decimals (e.g. 0.8 for 80% training, 0.2 for 20% evaluation)."},"SplitsAnalysis":{"properties":{"train_count":{"type":"integer","title":"Train Count"},"val_count":{"type":"integer","title":"Val Count"},"train_distribution":{"items":{"$ref":"#/components/schemas/LabelDistribution"},"type":"array","title":"Train Distribution"},"val_distribution":{"items":{"$ref":"#/components/schemas/LabelDistribution"},"type":"array","title":"Val Distribution"},"split_ratio_actual":{"$ref":"#/components/schemas/SplitRatio"}},"type":"object","required":["train_count","val_count","train_distribution","val_distribution","split_ratio_actual"],"title":"SplitsAnalysis"},"StopJobResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["success","message","job_id","status"],"title":"StopJobResponse","description":"Response after stopping a training job"},"SuccessResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"}},"type":"object","title":"SuccessResponse","description":"Generic success response."},"SynthesisLogCreate":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"UUID grouping all entries for one synthesis session"},"entry_type":{"type":"string","enum":["prompt","seed_generation","seed_feedback","prompt_update","expansion","finalization"],"title":"Entry Type","description":"Type of log entry"},"content":{"additionalProperties":true,"type":"object","title":"Content","description":"Flexible payload keyed by entry_type"},"dataset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Id","description":"Dataset ID, set when already linked"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID for the session"}},"type":"object","required":["session_id","entry_type"],"title":"SynthesisLogCreate","description":"Request body for creating a single synthesis log entry."},"SynthesisLogDatasetResponse":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"entries":{"items":{"$ref":"#/components/schemas/SynthesisLogEntry"},"type":"array","title":"Entries"}},"type":"object","required":["dataset_id","entries"],"title":"SynthesisLogDatasetResponse","description":"Response containing all synthesis log entries linked to a dataset."},"SynthesisLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"dataset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"session_id":{"type":"string","title":"Session Id"},"entry_type":{"type":"string","enum":["prompt","seed_generation","seed_feedback","prompt_update","expansion","finalization"],"title":"Entry Type"},"content":{"additionalProperties":true,"type":"object","title":"Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","session_id","entry_type","content","created_at"],"title":"SynthesisLogEntry","description":"Single synthesis log entry returned from the API."},"SynthesisLogLinkRequest":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id","description":"Dataset UUID to associate with every entry in the session"}},"type":"object","required":["dataset_id"],"title":"SynthesisLogLinkRequest","description":"Request body for linking a synthesis session to a dataset."},"SynthesisLogSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"entries":{"items":{"$ref":"#/components/schemas/SynthesisLogEntry"},"type":"array","title":"Entries"}},"type":"object","required":["session_id","entries"],"title":"SynthesisLogSessionResponse","description":"Response containing all entries for a synthesis session."},"SystemContentBlock":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text","default":""},"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control"}},"type":"object","title":"SystemContentBlock","description":"A system content block in Anthropic format."},"TeamBillingFullStatusResponse":{"properties":{"team_id":{"type":"string","title":"Team Id"},"team_name":{"type":"string","title":"Team Name"},"payment_plan":{"type":"string","title":"Payment Plan"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"},"payment_methods":{"items":{"$ref":"#/components/schemas/PaymentMethodInfo"},"type":"array","title":"Payment Methods"},"total_usage":{"type":"number","title":"Total Usage"},"credit_limit":{"type":"number","title":"Credit Limit"},"free_tier_remaining":{"type":"number","title":"Free Tier Remaining"},"exceeds_free_tier":{"type":"boolean","title":"Exceeds Free Tier"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"True when the subscription is scheduled to cancel at the end of the current billing period.","default":false},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End","description":"ISO timestamp when the current billing period ends. Present when cancel_at_period_end is true."}},"type":"object","required":["team_id","team_name","payment_plan","has_payment_method","total_usage","credit_limit","free_tier_remaining","exceeds_free_tier"],"title":"TeamBillingFullStatusResponse","description":"Full billing status for a team (for billing/admin/owner roles)."},"TeamBillingStatusResponse":{"properties":{"team_id":{"type":"string","title":"Team Id"},"team_name":{"type":"string","title":"Team Name"},"owner_name":{"type":"string","title":"Owner Name"},"payment_plan":{"type":"string","title":"Payment Plan"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"}},"type":"object","required":["team_id","team_name","owner_name","payment_plan","has_payment_method"],"title":"TeamBillingStatusResponse","description":"Response model for team billing status (limited info for team members)."},"TeamCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Name for the team"}},"type":"object","required":["name"],"title":"TeamCreate","description":"Request model for creating a team."},"TeamDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"team_id":{"type":"string","title":"Team Id"}},"type":"object","required":["success","message","team_id"],"title":"TeamDeleteResponse","description":"Response model for deleting a team."},"TeamInvitationCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Email address of the person to invite"},"role":{"$ref":"#/components/schemas/TeamRole","description":"Role to assign to the invitee","default":"viewer"}},"type":"object","required":["email"],"title":"TeamInvitationCreate","description":"Request model for inviting a member to a team."},"TeamInvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"team_id":{"type":"string","title":"Team Id"},"team_name":{"type":"string","title":"Team Name"},"email":{"type":"string","title":"Email"},"role":{"$ref":"#/components/schemas/TeamRole"},"status":{"$ref":"#/components/schemas/InvitationStatus"},"invited_by":{"type":"string","title":"Invited By"},"inviter_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inviter Name"},"inviter_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inviter Email"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["id","team_id","team_name","email","role","status","invited_by","created_at","expires_at"],"title":"TeamInvitationResponse","description":"Response model for a team invitation."},"TeamInvitationsListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"invitations":{"items":{"$ref":"#/components/schemas/TeamInvitationResponse"},"type":"array","title":"Invitations"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["invitations","count"],"title":"TeamInvitationsListResponse","description":"Response model for listing team invitations."},"TeamLeaveResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"team_id":{"type":"string","title":"Team Id"},"new_active_team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Active Team Id"}},"type":"object","required":["success","message","team_id"],"title":"TeamLeaveResponse","description":"Response model for leaving a team."},"TeamListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"teams":{"items":{"$ref":"#/components/schemas/TeamResponse"},"type":"array","title":"Teams"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["teams","count"],"title":"TeamListResponse","description":"Response model for listing teams."},"TeamMemberMfaStatus":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"has_mfa":{"type":"boolean","title":"Has Mfa"}},"type":"object","required":["user_id","email","has_mfa"],"title":"TeamMemberMfaStatus","description":"MFA enrollment status for a single team member.\n\n``has_mfa`` is True when the member has at least one verified TOTP\nfactor; failed admin-API lookups fall back to ``has_mfa=False`` with\nan empty ``email`` so the surface degrades rather than 500-ing."},"TeamMemberRemoveResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"user_id":{"type":"string","title":"User Id"},"team_id":{"type":"string","title":"Team Id"}},"type":"object","required":["success","message","user_id","team_id"],"title":"TeamMemberRemoveResponse","description":"Response model for removing a team member."},"TeamMemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"team_id":{"type":"string","title":"Team Id"},"user_id":{"type":"string","title":"User Id"},"role":{"$ref":"#/components/schemas/TeamRole"},"joined_at":{"type":"string","title":"Joined At"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"user_avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Avatar Url"},"mfa_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mfa Enabled"},"mfa_factor_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mfa Factor Count"}},"type":"object","required":["id","team_id","user_id","role","joined_at"],"title":"TeamMemberResponse","description":"Response model for a team member.\n\n``mfa_enabled`` and ``mfa_factor_count`` are sensitive targeting data\nand are populated only on the members-list response, and only for\ncallers holding ``MANAGE_BILLING`` — matching the gated\n``/teams/{id}/members/mfa-status`` surface. ``None`` means the field\nwas not populated (caller lacks the permission, or the endpoint does\nnot enrich it), never that MFA is disabled. Endpoints that do not\nenrich (e.g. role update) leave both fields ``None``."},"TeamMemberUsage":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"total_credits":{"type":"number","title":"Total Credits"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["user_id","email","full_name","total_credits","request_count"],"title":"TeamMemberUsage","description":"Usage information for a team member."},"TeamMembersListResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"members":{"items":{"$ref":"#/components/schemas/TeamMemberResponse"},"type":"array","title":"Members"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["members","count"],"title":"TeamMembersListResponse","description":"Response model for listing team members."},"TeamMembersMfaStatusResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/TeamMemberMfaStatus"},"type":"array","title":"Members"}},"type":"object","required":["members"],"title":"TeamMembersMfaStatusResponse","description":"Response model for the gated members MFA-status surface."},"TeamResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"owner_id":{"type":"string","title":"Owner Id"},"payment_plan":{"type":"string","title":"Payment Plan"},"router_enabled":{"type":"boolean","title":"Router Enabled","default":true},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"member_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Member Count"},"current_user_role":{"anyOf":[{"$ref":"#/components/schemas/TeamRole"},{"type":"null"}]},"capabilities":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Capabilities"}},"type":"object","required":["id","name","owner_id","payment_plan","created_at","updated_at"],"title":"TeamResponse","description":"Response model for a single team."},"TeamRole":{"type":"string","enum":["owner","billing","admin","editor","viewer"],"title":"TeamRole","description":"Team member roles with hierarchical permissions."},"TeamRoleUpdate":{"properties":{"role":{"$ref":"#/components/schemas/TeamRole","description":"New role for the team member"}},"type":"object","required":["role"],"title":"TeamRoleUpdate","description":"Request model for updating a member's role."},"TeamSettingsUpdate":{"properties":{"router_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Router Enabled","description":"Enable the team's auto model-router"}},"type":"object","title":"TeamSettingsUpdate","description":"Allowed fields for PATCH /teams/{team_id}/settings."},"TeamUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"New name for the team"}},"type":"object","title":"TeamUpdate","description":"Request model for updating a team."},"TeamUsageResponse":{"properties":{"team_id":{"type":"string","title":"Team Id"},"team_name":{"type":"string","title":"Team Name"},"total_usage":{"type":"number","title":"Total Usage"},"members":{"items":{"$ref":"#/components/schemas/TeamMemberUsage"},"type":"array","title":"Members"}},"type":"object","required":["team_id","team_name","total_usage","members"],"title":"TeamUsageResponse","description":"Response model for team member usage breakdown."},"TerminateJobResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"job_id":{"type":"string","title":"Job Id"},"deleted_checkpoints":{"type":"integer","title":"Deleted Checkpoints"}},"type":"object","required":["success","message","job_id","deleted_checkpoints"],"title":"TerminateJobResponse","description":"Response after terminating a training job"},"TextCompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","default":0},"text":{"type":"string","title":"Text","default":""},"logprobs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Logprobs"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content"}},"type":"object","title":"TextCompletionChoice","description":"A single text completion choice.\n\nThe OpenAI ``/v1/completions`` chunk / response schema has no\nreasoning slot. Pioneer adopts the de facto vLLM extension and\nexposes upstream reasoning on ``reasoning_content`` so this surface\nstays symmetric with ``/v1/chat/completions``\n(:class:`ChatCompletionStreamDelta` and ``message.reasoning_content``).\nStock OpenAI SDK consumers reading only ``text`` ignore the unknown\nfield; reasoning-aware consumers drain both. The streaming-chunk\nrenderer at\n:class:`~services.inference.adapters.openai_text._TextStreamRenderer`\nemits ``choices[0].reasoning_content`` on the wire for thinking\ndeltas."},"TextCompletionRequest":{"properties":{"model":{"type":"string","title":"Model"},"prompt":{"type":"string","title":"Prompt"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"max_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens"},"stop":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"title":"Stop"},"echo":{"type":"boolean","title":"Echo","default":false},"logprobs":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":0.0},{"type":"null"}],"title":"Logprobs"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream"},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body"},"reasoning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Reasoning","description":"Opt-in reasoning / extended-thinking controls. Accepts the OpenRouter-normalized shape (``enabled``, ``max_tokens``, ``effort``, ``exclude``); ``effort`` and ``max_tokens`` are mutually exclusive. Pioneer extensions for Claude routes: ``mode`` (manual/adaptive) and ``display`` (summarized/omitted). Pioneer canonicalizes this and renders each provider's native field at the wire boundary."},"store":{"type":"boolean","title":"Store","default":true},"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema","description":"Schema for the Pioneer encoder. **Deprecated when supplied as a flat list** of entity labels; use the unified dict shape instead. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"**Deprecated.** Legacy task hint. The unified schema disambiguates the task automatically. Submitting this field emits ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers."},"include_confidence":{"type":"boolean","title":"Include Confidence","default":true},"include_spans":{"type":"boolean","title":"Include Spans","default":true}},"type":"object","required":["model","prompt"],"title":"TextCompletionRequest","description":"OpenAI-compatible text completion request."},"TextCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"text_completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#/components/schemas/TextCompletionChoice"},"type":"array","title":"Choices"},"usage":{"$ref":"#/components/schemas/ChatCompletionUsage"},"x_pioneer":{"anyOf":[{"$ref":"#/components/schemas/PioneerExtension"},{"type":"null"}]}},"type":"object","required":["model","choices","usage"],"title":"TextCompletionResponse","description":"OpenAI-compatible text completion response."},"TokenVolumeTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date","description":"ISO date or datetime string"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["bucket_date","input_tokens","output_tokens","total_tokens","request_count"],"title":"TokenVolumeTimeseriesPoint","description":"One bucket of aggregated token volume."},"TokenVolumeTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/TokenVolumeTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["points"],"title":"TokenVolumeTimeseriesResponse","description":"Token volume timeseries for charts."},"ToolInfo":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"ToolInfo","description":"Tool information."},"ToolsResponse":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/ToolInfo"},"type":"array","title":"Tools"},"client_type":{"type":"string","title":"Client Type"}},"type":"object","required":["tools","client_type"],"title":"ToolsResponse","description":"Response for tools endpoint."},"TrainingDatasetRow":{"properties":{"id":{"type":"string","title":"Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"version_number":{"type":"string","title":"Version Number"},"dataset_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Type","description":"Domain type of the dataset (ner, classification, custom, decoder)."},"generation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Type","description":"How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external."},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","dataset_name","version_number"],"title":"TrainingDatasetRow","description":"Dataset row rendered under the \"Training datasets\" section."},"TrainingJobCreate":{"properties":{"model_name":{"type":"string","maxLength":100,"minLength":1,"title":"Model Name","description":"User-friendly name for the trained model"},"datasets":{"items":{"$ref":"#/components/schemas/DatasetReference"},"type":"array","minItems":1,"title":"Datasets","description":"Datasets to train on (supports multi-dataset training)"},"base_model":{"type":"string","minLength":1,"title":"Base Model","description":"HuggingFace model identifier (e.g. 'fastino/gliner2-base-v1', 'Qwen/Qwen3-8B')."},"training_type":{"type":"string","enum":["full","lora"],"title":"Training Type","description":"Training type: 'full' or 'lora'","default":"lora"},"validation_data_percentage":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Validation Data Percentage","description":"Fraction of data held out for validation.","default":0.2},"nr_epochs":{"type":"integer","minimum":1.0,"title":"Nr Epochs","description":"Maximum training epochs. With early stopping enabled, training typically terminates well before this ceiling.","default":100},"learning_rate":{"type":"number","exclusiveMinimum":0.0,"title":"Learning Rate","description":"Peak learning rate for AdamW.","default":2e-05},"batch_size":{"type":"integer","minimum":1.0,"title":"Batch Size","description":"Batch size","default":4},"save_steps":{"type":"integer","minimum":1.0,"title":"Save Steps","description":"Save checkpoint every N steps","default":100},"profile_training":{"type":"boolean","title":"Profile Training","description":"Enable structured training profiling for this run and persist a training_profile.json artifact.","default":false},"wandb_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wandb Api Key","description":"Optional W&B API key for logging"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID to associate with this training job. When omitted, the job is anchored to the caller's auto-managed \"Default\" project so it is always deployable and fleet-eligible."},"lora_r":{"type":"integer","title":"Lora R","description":"LoRA rank","default":16},"lora_alpha":{"type":"integer","title":"Lora Alpha","description":"LoRA alpha","default":32},"lora_dropout":{"type":"number","title":"Lora Dropout","description":"LoRA dropout","default":0.1},"warmup_ratio":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Warmup Ratio","description":"Fraction of total training steps for linear LR warmup. Ignored when warmup_steps is set.","default":0.0},"warmup_steps":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Warmup Steps","description":"Absolute number of linear LR warmup steps. When set, takes priority over warmup_ratio."},"lr_scheduler_type":{"type":"string","title":"Lr Scheduler Type","description":"LR decay schedule after warmup: 'constant', 'linear', or 'cosine'.","default":"cosine"},"weight_decay":{"type":"number","minimum":0.0,"title":"Weight Decay","description":"AdamW weight decay (L2 penalty). 0 disables weight decay. Honoured by Modal training paths. Ignored by Fireworks managed SFT — Fireworks V2 rejects optimizerWeightDecay with HTTP 400 and applies its own server-side default (0).","default":0.01},"early_stopping_patience":{"type":"integer","minimum":0.0,"title":"Early Stopping Patience","description":"Validation epochs without improvement before stopping. Requires validation_data_percentage > 0. Set to 0 to disable.","default":3},"early_stopping_min_delta":{"type":"number","minimum":0.0,"title":"Early Stopping Min Delta","description":"Minimum validation loss improvement to count as progress. Prevents early stopping from triggering on noise.","default":0.0001},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name","description":"Pin training to a specific provider (e.g. 'fireworks', 'modal'). Bypasses automatic provider selection."},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt","description":"Canonical system prompt written to every decoder training row. When populated, it is persisted on ``training_jobs.system_prompt`` and re-injected by inference providers for API-direct callers that omit the ``system`` message (train/serve alignment), and prefills the inference-page system-prompt editor. Leave null for PAFT datasets, mixed-prompt uploads, or any case where no single prompt should be pinned at serve time. Ignored for non-decoder tasks."},"encoder_learning_rate":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Encoder Learning Rate","description":"GLiNER only: learning rate applied to encoder parameters. When omitted, falls back to `learning_rate`."},"task_learning_rate":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Task Learning Rate","description":"GLiNER only: learning rate applied to task-head parameters. When omitted, falls back to `learning_rate`."},"gradient_accumulation_steps":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Gradient Accumulation Steps","description":"GLiNER only: accumulate gradients over N mini-batches before each optimizer step. Effective batch size = batch_size * N."},"auto_data_sizing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Data Sizing","description":"GLiNER only. Opt-in: when true, downsample each training dataset to min(max_samples_per_dataset, max(min_samples_per_dataset, samples_per_label * num_labels)). When omitted or false, the full provided dataset is used (no silent downsampling). Defaults to false in the Modal container."},"min_samples_per_dataset":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Min Samples Per Dataset","description":"GLiNER only: lower bound for auto-sized dataset cap."},"max_samples_per_dataset":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Samples Per Dataset","description":"GLiNER only: upper bound for auto-sized dataset cap."},"samples_per_label":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Samples Per Label","description":"GLiNER only: scaling factor used when computing the auto-sized per-dataset cap."},"min_training_steps":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Min Training Steps","description":"GLiNER only: minimum number of optimizer steps; raises epoch count if the provided `nr_epochs` would yield fewer steps."},"training_algorithm":{"type":"string","enum":["sft","grpo","dpo"],"title":"Training Algorithm","description":"Training algorithm: 'sft' (default), 'grpo', or 'dpo'. GRPO and DPO are dispatched to the Modal RL entrypoint. GRPO requires rl_config.reward_type from the built-in menu; DPO requires {prompt, chosen, rejected} columns and optional rl_config.dpo_beta / loss_type.","default":"sft"},"rl_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rl Config","description":"Algorithm-specific hyperparameters for RL training. Supported keys (all optional unless noted, TRL-aligned defaults applied container-side): max_steps, kl_beta, group_size, sampling_temperature, max_completion_length, reward_type (GRPO; required, one of the built-in reward function names — see rl_training._BUILTIN_REWARDS); dpo_beta, loss_type (DPO); logging_steps (both; defaults to 25, lower for short smoke runs). When reward_type == 'llm_as_judge' (GRPO only) the judge call is routed through brain's '/v1/chat/completions' API authenticated with a per-run pio_sk_* key minted by ModalTrainingHandler._launch_and_monitor immediately before spawning the Modal function (the user never supplies the key — minted in the workqueue handler so the cleartext value never enters the SQS message body, injected into the Modal payload at spawn time, revoked from the post-training cleanup hook on terminal status). Additional knobs: llm_judge_model (HuggingFace model id, default 'meta-llama/Llama-3.1-8B-Instruct' — must resolve to a brain catalog entry via resolve_catalog_model_id), llm_judge_rubric (template string with {prompt}/{completion}/{answer} placeholders; falls back to a generic faithfulness/quality rubric scored 1-10 when absent), llm_judge_score_scale (raw max score for normalisation to [0,1], default 10), llm_judge_timeout_s (HTTP timeout per judge call, default 30), llm_judge_max_concurrent (parallelism cap on judge HTTP calls, default 8), llm_judge_max_retries (per-row retry budget on transient HTTP errors, default 1), llm_judge_retry_backoff_s (sleep between retries, default 2.0)."}},"type":"object","required":["model_name","datasets","base_model"],"title":"TrainingJobCreate","description":"Request to create a training job."},"TrainingJobListResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"training_jobs":{"items":{"$ref":"#/components/schemas/TrainingJobResponse"},"type":"array","title":"Training Jobs"},"count":{"type":"integer","title":"Count"},"total":{"type":"integer","title":"Total","description":"Total number of matching jobs (before pagination).","default":0},"has_more":{"type":"boolean","title":"Has More","description":"True when more results exist beyond this page.","default":false}},"type":"object","required":["success","training_jobs","count"],"title":"TrainingJobListResponse","description":"List of training jobs response."},"TrainingJobResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project ID this training job is associated with"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name","default":"Unnamed Model"},"datasets":{"items":{"$ref":"#/components/schemas/DatasetReference"},"type":"array","title":"Datasets"},"base_model":{"type":"string","title":"Base Model"},"validation_data_percentage":{"type":"number","title":"Validation Data Percentage"},"nr_epochs":{"type":"integer","title":"Nr Epochs"},"learning_rate":{"type":"number","title":"Learning Rate"},"batch_size":{"type":"integer","title":"Batch Size"},"trained_model_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trained Model Path"},"job_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Reference"},"instance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Type"},"status":{"type":"string","title":"Status"},"normalized_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Normalized Status","description":"Canonical status alias for compatibility handling (requested, running, complete, deployed, failed, cancelled)"},"is_terminal_status":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Terminal Status","description":"Whether this status is terminal for polling loops"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"model_auto_selected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Model Auto Selected"},"model_selection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Selection Reason"},"task_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type","description":"Task type derived from training datasets: 'ner', 'classification', 'custom', or 'decoder'"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Merged labels from training datasets (entity types for NER, class labels for classification)"},"example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example","description":"Sample text to pre-load into inference input"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics","description":"Training and evaluation metrics dictionary. Contains final_training_loss, final_validation_loss, best_validation_loss from training logs, and optional evaluation metrics (f1_score, precision_score, recall_score, accuracy) if an evaluation has been run."},"version_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Number","description":"Version number for this training job (e.g., '1', '2', '3')"},"root_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Job Id","description":"ID of the original/root training job this version derives from"},"provider_deployments":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Deployments","description":"Provider-specific deployment metadata written by the training monitor. For Fireworks: {\"fireworks\": {\"deployment_name\": ...}}."},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name","description":"Training provider that handled this job (e.g. 'fireworks', 'modal')."},"progress_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Percent","description":"Overall training completion percentage (0-100). Updated live during training."},"current_epoch":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Epoch","description":"Epoch currently in progress (1-indexed). Updated live during training."},"deployment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployment Status","description":"Deprecated. Always returns None -- deployment_status no longer exists.\n\nKept for backward compat with clients that read this field.","readOnly":true}},"type":"object","required":["id","user_id","datasets","base_model","validation_data_percentage","nr_epochs","learning_rate","batch_size","status","created_at","updated_at","deployment_status"],"title":"TrainingJobResponse","description":"Training job response model"},"TrainingJobUpdate":{"properties":{"project_id":{"anyOf":[{"type":"string","pattern":"(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},{"type":"null"}],"title":"Project Id","description":"Project ID (UUID) to assign the training job to, or null to unassign."}},"additionalProperties":false,"type":"object","title":"TrainingJobUpdate","description":"Thin PATCH body for ``PATCH /felix/training-jobs/{job_id}``.\n\nExposes only ``project_id``. Send ``null`` to unassign the training job\nfrom its current project. Unknown fields are rejected with HTTP 422.\n\nMovement semantics: this endpoint moves only the ``training_jobs.project_id``\nlabel. It does NOT cascade ``project_id`` updates to dependent rows\n(``deployments``, ``inferences``, ``model_evaluations``) which each carry\ntheir own ``project_id``. Those records remain attached to their original\nproject. Callers needing aggregate-model movement must update the\ndependents explicitly."},"TrainingLogsResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"logs":{"items":{"$ref":"#/components/schemas/TrainingOutputLogEntry"},"type":"array","title":"Logs"},"total_logs":{"type":"integer","title":"Total Logs"}},"type":"object","required":["job_id","logs","total_logs"],"title":"TrainingLogsResponse","description":"Response containing training output logs for a job"},"TrainingOutputLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"job_id":{"type":"string","title":"Job Id"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"level":{"type":"string","title":"Level"},"message":{"type":"string","title":"Message"},"source":{"type":"string","title":"Source"}},"type":"object","required":["id","job_id","timestamp","level","message","source"],"title":"TrainingOutputLogEntry","description":"Single training output log entry (stdout/stderr)"},"TrainingPipelineCreate":{"properties":{"model_name":{"type":"string","title":"Model Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"stages":{"items":{"$ref":"#/components/schemas/TrainingPipelineStageCreate"},"type":"array","maxItems":10,"minItems":1,"title":"Stages"},"auto_deploy_final_stage":{"type":"boolean","title":"Auto Deploy Final Stage","default":true}},"additionalProperties":false,"type":"object","required":["model_name","stages"],"title":"TrainingPipelineCreate","description":"Request to create a multi-stage training pipeline."},"TrainingPipelineCreateResponse":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"status":{"type":"string","title":"Status"},"estimated_total_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Total Usd"},"stages":{"items":{"$ref":"#/components/schemas/TrainingPipelineStageCreateResponse"},"type":"array","title":"Stages"}},"type":"object","required":["pipeline_id","status","stages"],"title":"TrainingPipelineCreateResponse","description":"Created pipeline root and stage summary."},"TrainingPipelineDeploymentHistoryEntry":{"properties":{"stage_job_id":{"type":"string","title":"Stage Job Id"},"stage_index":{"type":"integer","title":"Stage Index"},"status":{"type":"string","title":"Status"},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"},"normalized_adapter_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Normalized Adapter Path"},"provider_deployments":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Deployments"},"deployed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deployed At"}},"type":"object","required":["stage_job_id","stage_index","status"],"title":"TrainingPipelineDeploymentHistoryEntry","description":"Deployment or artifact history derived from a pipeline stage."},"TrainingPipelineDeploymentHistoryResponse":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"deployments":{"items":{"$ref":"#/components/schemas/TrainingPipelineDeploymentHistoryEntry"},"type":"array","title":"Deployments"}},"type":"object","required":["pipeline_id","deployments"],"title":"TrainingPipelineDeploymentHistoryResponse","description":"Deployment history for one pipeline root."},"TrainingPipelineDetailResponse":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"status":{"type":"string","title":"Status"},"status_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Message"},"estimated_total_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Total Usd"},"total_stage_count":{"type":"integer","title":"Total Stage Count"},"completed_stage_count":{"type":"integer","title":"Completed Stage Count"},"active_stage_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Stage Index"},"progress_percent":{"type":"integer","title":"Progress Percent"},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"branched_from_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branched From Job Id"},"pipeline_recipe":{"additionalProperties":true,"type":"object","title":"Pipeline Recipe"},"stages":{"items":{"$ref":"#/components/schemas/TrainingPipelineStageRead"},"type":"array","title":"Stages"},"deployment_history":{"items":{"$ref":"#/components/schemas/TrainingPipelineDeploymentHistoryEntry"},"type":"array","title":"Deployment History"}},"type":"object","required":["pipeline_id","status","total_stage_count","completed_stage_count","progress_percent","created_at","updated_at","pipeline_recipe","stages","deployment_history"],"title":"TrainingPipelineDetailResponse","description":"Detailed pipeline read response with stage lineage."},"TrainingPipelineEstimateResponse":{"properties":{"total_estimated_usd":{"type":"number","title":"Total Estimated Usd"},"total_estimated_minutes":{"type":"integer","title":"Total Estimated Minutes"},"stages":{"items":{"$ref":"#/components/schemas/TrainingPipelineStageEstimate"},"type":"array","title":"Stages"},"assumptions":{"items":{"type":"string"},"type":"array","title":"Assumptions"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["total_estimated_usd","total_estimated_minutes","stages","assumptions","confidence"],"title":"TrainingPipelineEstimateResponse","description":"Read-only cost estimate for a training pipeline recipe."},"TrainingPipelineListItem":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"status":{"type":"string","title":"Status"},"status_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Message"},"estimated_total_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Total Usd"},"total_stage_count":{"type":"integer","title":"Total Stage Count"},"completed_stage_count":{"type":"integer","title":"Completed Stage Count"},"active_stage_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Stage Index"},"progress_percent":{"type":"integer","title":"Progress Percent"},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["pipeline_id","status","total_stage_count","completed_stage_count","progress_percent","created_at","updated_at"],"title":"TrainingPipelineListItem","description":"Pipeline summary for list responses."},"TrainingPipelineListResponse":{"properties":{"pipelines":{"items":{"$ref":"#/components/schemas/TrainingPipelineListItem"},"type":"array","title":"Pipelines"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["pipelines","limit","offset"],"title":"TrainingPipelineListResponse","description":"Paginated pipeline list response."},"TrainingPipelineStageCreate":{"properties":{"base_model":{"type":"string","title":"Base Model"},"training_type":{"type":"string","enum":["full","lora"],"title":"Training Type","default":"lora"},"training_algorithm":{"type":"string","enum":["sft","dpo","grpo"],"title":"Training Algorithm","default":"sft"},"datasets":{"items":{"$ref":"#/components/schemas/DatasetReference"},"type":"array","minItems":1,"title":"Datasets"},"parent_stage_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Stage Index"},"merge_parent_before":{"type":"boolean","title":"Merge Parent Before","default":false},"rl_config":{"anyOf":[{"$ref":"#/components/schemas/RLConfig"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["base_model","datasets"],"title":"TrainingPipelineStageCreate","description":"One requested stage in a training pipeline recipe.\n\nPipeline v1 accepts only routing, dependency, and dataset shape fields.\nCreation dispatches stages with service-owned default hyperparameters until\nper-stage overrides are added to this schema."},"TrainingPipelineStageCreateResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"stage_index":{"type":"integer","title":"Stage Index"},"status":{"type":"string","title":"Status"},"job_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Reference"},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"}},"type":"object","required":["job_id","stage_index","status"],"title":"TrainingPipelineStageCreateResponse","description":"Created pipeline stage summary."},"TrainingPipelineStageEstimate":{"properties":{"stage_index":{"type":"integer","title":"Stage Index"},"base_model":{"type":"string","title":"Base Model"},"training_type":{"type":"string","title":"Training Type"},"training_algorithm":{"type":"string","title":"Training Algorithm"},"dataset_count":{"type":"integer","title":"Dataset Count"},"dataset_row_count":{"type":"integer","title":"Dataset Row Count"},"estimated_minutes":{"type":"integer","title":"Estimated Minutes"},"estimated_usd":{"type":"number","title":"Estimated Usd"},"assumptions":{"items":{"type":"string"},"type":"array","title":"Assumptions"}},"type":"object","required":["stage_index","base_model","training_type","training_algorithm","dataset_count","dataset_row_count","estimated_minutes","estimated_usd"],"title":"TrainingPipelineStageEstimate","description":"Estimated cost and duration for one pipeline stage."},"TrainingPipelineStageRead":{"properties":{"job_id":{"type":"string","title":"Job Id"},"stage_index":{"type":"integer","title":"Stage Index"},"status":{"type":"string","title":"Status"},"status_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Message"},"current_substep":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Substep"},"base_model":{"type":"string","title":"Base Model"},"training_type":{"type":"string","title":"Training Type"},"training_algorithm":{"type":"string","title":"Training Algorithm"},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"},"job_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Reference"},"parent_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Job Id"},"merge_parent_before":{"type":"boolean","title":"Merge Parent Before","default":false},"dataset_ids":{"items":{"type":"string"},"type":"array","title":"Dataset Ids"},"train_dataset_paths":{"items":{"type":"string"},"type":"array","title":"Train Dataset Paths"},"normalized_adapter_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Normalized Adapter Path"},"provider_deployments":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Deployments"},"progress_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Percent"},"current_epoch":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Epoch"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","stage_index","status","base_model","training_type","training_algorithm","created_at","updated_at"],"title":"TrainingPipelineStageRead","description":"Read model for one persisted pipeline stage."},"TriggerAgentRunRequest":{"properties":{"project_id":{"type":"string","title":"Project Id","description":"Project to run the agent for."}},"type":"object","required":["project_id"],"title":"TriggerAgentRunRequest","description":"Request body for manual agent run trigger."},"TriggerAgentRunResponse":{"properties":{"agent_run_id":{"type":"string","title":"Agent Run Id","description":"Created agent run ID."},"status":{"type":"string","title":"Status","description":"Initial run status (queued)."},"message":{"type":"string","title":"Message","description":"Human-readable status message."}},"type":"object","required":["agent_run_id","status","message"],"title":"TriggerAgentRunResponse","description":"Response for manual agent run trigger."},"UpdateModelNameRequest":{"properties":{"model_name":{"type":"string","maxLength":64,"minLength":1,"title":"Model Name","description":"New model name (alphanumeric, hyphens, underscores)"}},"type":"object","required":["model_name"],"title":"UpdateModelNameRequest","description":"Request to update a training job's model name"},"UpdateModelNameResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"job_id":{"type":"string","title":"Job Id"},"model_name":{"type":"string","title":"Model Name"}},"type":"object","required":["success","message","job_id","model_name"],"title":"UpdateModelNameResponse","description":"Response model for updating model name"},"UpdateOverageSettingsRequest":{"properties":{"overage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Overage Enabled"},"topup_amount":{"anyOf":[{"type":"number","maximum":100000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Topup Amount","description":"Credits per top-up (100 = $1)"},"topup_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topup Mode","description":"Top-up mode: 'by' or 'to'"},"charge_threshold":{"anyOf":[{"type":"number","maximum":50000.0,"minimum":0.0},{"type":"null"}],"title":"Charge Threshold","description":"Remaining credits trigger"},"max_monthly_spend":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Max Monthly Spend","description":"Monthly cap (null to remove)"},"usage_reset_hour":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Usage Reset Hour","description":"Local hour for daily reset. Must be between 0 and 23."},"usage_reset_timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Reset Timezone","description":"IANA timezone used to interpret usage_reset_hour."}},"type":"object","title":"UpdateOverageSettingsRequest","description":"Request to update overage billing settings."},"UpdateResourceProjectRequest":{"properties":{"project_id":{"type":"string","title":"Project Id","description":"Project ID to assign, or empty string to unassign"}},"type":"object","required":["project_id"],"title":"UpdateResourceProjectRequest","description":"Request to assign a resource to a project (or unassign with empty string)."},"UpdateResourceProjectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"UpdateResourceProjectResponse","description":"Response for project assignment update."},"UpdateUserProfileRequest":{"properties":{"onboarded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Onboarded"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"agent_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Mode"},"preferred_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Language"},"preferred_framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Framework"},"adaptive_learning_cadence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adaptive Learning Cadence"},"team_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Size"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"},"training_opt_out":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Training Opt Out"}},"type":"object","title":"UpdateUserProfileRequest","description":"Request for updating user profile fields.\n\nAttributes:\n    onboarded: Mark onboarding as complete.\n    intent: User's chosen workflow intent from onboarding.\n    agent_mode: Preferred agent mode ('mle' or 'auto').\n    preferred_language: Preferred code language for inference snippets.\n    preferred_framework: Preferred API framework for inference snippets.\n    team_size: Self-reported team size bucket from onboarding.\n    org_name: Organisation name from onboarding (persisted + Attio).\n    use_case: Free-text use case from onboarding (persisted + Attio)."},"UpdateUserProfileResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"UpdateUserProfileResponse","description":"Response for user profile update."},"UpgradeAccountRequest":{"properties":{"plan":{"type":"string","enum":["hobby","pro","research","enterprise"],"title":"Plan","description":"Target plan to upgrade to"},"success_url":{"type":"string","title":"Success Url","description":"URL to redirect to after successful payment"},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL to redirect to if user cancels"},"force_checkout":{"type":"boolean","title":"Force Checkout","description":"When true, skip using existing payment method and always create a Stripe Checkout session.","default":false}},"type":"object","required":["plan","success_url","cancel_url"],"title":"UpgradeAccountRequest","description":"Request model for upgrading account plan."},"UpgradeAccountResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"already_subscribed":{"type":"boolean","title":"Already Subscribed","default":false},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"UpgradeAccountResponse","description":"Response model for upgrade account."},"UpgradeTeamPlanRequest":{"properties":{"plan":{"type":"string","enum":["pro","research"],"title":"Plan","description":"Target plan to upgrade to"},"promotion_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promotion Code","description":"Optional Stripe promotion code to apply"}},"type":"object","required":["plan"],"title":"UpgradeTeamPlanRequest","description":"Request for direct team plan upgrade (no Checkout redirect)."},"UpgradeTeamPlanResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"plan":{"type":"string","title":"Plan"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","plan","message"],"title":"UpgradeTeamPlanResponse","description":"Response for direct team plan upgrade."},"UploadEvaluationRequest":{"properties":{"model_id":{"type":"string","title":"Model Id","description":"Model identifier used for the evaluation"},"dataset_name":{"type":"string","title":"Dataset Name","description":"Pioneer dataset name the evaluation was run against"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version","description":"Dataset version (latest if omitted)"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Optional project ID to associate the evaluation with"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name","description":"Optional human-readable model name for the UI"},"status":{"type":"string","enum":["complete","failed","errored"],"title":"Status","description":"Final evaluation status. 'errored' is normalized to 'failed'.","default":"complete"},"f1_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"F1 Score"},"precision_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precision Score"},"recall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recall Score"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"validation_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Validation Loss"},"subset_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subset Accuracy"},"hamming_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hamming Loss"},"bleu_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bleu Score"},"rouge_l_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rouge L Score"},"total_tokens":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total Tokens"},"total_cost_usd":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Total Cost Usd"},"total_latency_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total Latency Ms"},"max_examples":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Examples"},"max_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Optional evaluation metadata stored in model_evaluations.config, for example threshold sweeps, schemas, judge criteria, or system prompts."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"error_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Error Count"},"error_sample":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Sample"},"failed_examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":10000},{"type":"null"}],"title":"Failed Examples"},"sample_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Sample Count"},"evaluation_time_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Evaluation Time Ms"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"predictions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":10000},{"type":"null"}],"title":"Predictions"},"result_rows":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadEvaluationResultRow"},"type":"array","maxItems":10000},{"type":"null"}],"title":"Result Rows"}},"type":"object","required":["model_id","dataset_name"],"title":"UploadEvaluationRequest","description":"Upload manually computed evaluation results to the platform."},"UploadEvaluationResultRow":{"properties":{"example_index":{"type":"integer","minimum":0.0,"title":"Example Index"},"input_text":{"type":"string","title":"Input Text"},"true_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"True Label"},"predicted_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Label"},"true_entities":{"anyOf":[{},{"type":"null"}],"title":"True Entities"},"predicted_entities":{"anyOf":[{},{"type":"null"}],"title":"Predicted Entities"},"correct":{"type":"boolean","title":"Correct"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"latency_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Latency Ms"}},"type":"object","required":["example_index","input_text","correct"],"title":"UploadEvaluationResultRow","description":"Per-example evaluation row uploaded to ``evaluation_results``."},"UsageHistoryRequest":{"properties":{"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Start date in ISO format (YYYY-MM-DD)"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"End date in ISO format (YYYY-MM-DD)"}},"type":"object","title":"UsageHistoryRequest","description":"Request model for usage history."},"UsageHistoryResponse":{"properties":{"total_tokens":{"type":"integer","title":"Total Tokens"},"total_credits":{"type":"number","title":"Total Credits"},"total_cost":{"type":"number","title":"Total Cost"},"request_count":{"type":"integer","title":"Request Count"},"requests":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Requests"},"requests_limit":{"type":"integer","title":"Requests Limit","description":"Maximum detailed request rows included in this response.","default":100},"requests_truncated":{"type":"boolean","title":"Requests Truncated","description":"Whether more matching request rows exist than are returned.","default":false},"resource_breakdown_30d":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Resource Breakdown 30D"}},"type":"object","required":["total_tokens","total_credits","total_cost","request_count","requests"],"title":"UsageHistoryResponse","description":"Response model for usage history."},"UsageRequestItem":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"credit_usage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit Usage"},"token_usage":{"type":"integer","title":"Token Usage","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens","default":0},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens","default":0},"cost":{"type":"number","title":"Cost","default":0.0},"endpoint":{"type":"string","title":"Endpoint","default":""},"model":{"type":"string","title":"Model","default":""}},"type":"object","required":["id","created_at"],"title":"UsageRequestItem","description":"A single row from ``public.requests`` for the usage table UI."},"UsageRequestsPageResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UsageRequestItem"},"type":"array","title":"Items"},"total_count":{"type":"integer","title":"Total Count"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total_count","page","page_size"],"title":"UsageRequestsPageResponse","description":"Paginated request log for the usage table UI."},"UsageTimeseriesPoint":{"properties":{"bucket_date":{"type":"string","title":"Bucket Date","description":"ISO date or datetime string"},"total_credits":{"type":"number","title":"Total Credits"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["bucket_date","total_credits","request_count"],"title":"UsageTimeseriesPoint","description":"One bucket of aggregated usage.\n\nFor daily granularity the value is an ISO date (``YYYY-MM-DD``).\nFor sub-daily intervals it is an ISO datetime (``YYYY-MM-DDTHH:MM:SS``)."},"UsageTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/UsageTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["points"],"title":"UsageTimeseriesResponse","description":"Daily usage series for charts."},"UserProfileResponse":{"properties":{"onboarded":{"type":"boolean","title":"Onboarded"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"agent_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Mode"},"preferred_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Language"},"preferred_framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Framework"},"active_team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Team Id"},"adaptive_learning_cadence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adaptive Learning Cadence"},"team_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Size"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"},"training_opt_out":{"type":"boolean","title":"Training Opt Out","default":false},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["onboarded"],"title":"UserProfileResponse","description":"Response for GET /users/me — returns the user's public profile fields."},"UserRegistrationRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"},"twitter_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twitter Url"},"linkedin_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linkedin Url"},"captcha_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captcha Token"}},"type":"object","required":["refresh_token"],"title":"UserRegistrationRequest","description":"Request for user registration with Google OAuth.\n\nThe user's email and full name are intentionally NOT accepted from the\nclient — the brain always sources them from the immutable Supabase\nauth identity (JWT email + ``auth.users.user_metadata``). Accepting them\nfrom the request body was a phishing primitive (ENG-1214) that allowed\nany authenticated user to overwrite ``public.users.email`` for their\nown row with an arbitrary string, e.g. another user's address."},"UserRegistrationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Id"}},"type":"object","required":["success","message"],"title":"UserRegistrationResponse","description":"Response for user registration."},"UserReportAttachmentUploadResponse":{"properties":{"attachments":{"items":{"type":"string"},"type":"array","title":"Attachments","description":"Attachment URLs stored on the report."}},"type":"object","required":["attachments"],"title":"UserReportAttachmentUploadResponse","description":"Response after uploading one or more report attachments."},"UserReportCreateRequest":{"properties":{"report_type":{"type":"string","enum":["bug","improvement","question","praise","feature","performance","accessibility","security","documentation","other"],"title":"Report Type","description":"Selected report category."},"title":{"type":"string","maxLength":200,"title":"Title","description":"Short generated title."},"description":{"type":"string","maxLength":10000,"title":"Description","description":"Full user report text."},"selected_element":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Selected Element","description":"Optional highlighted DOM element snapshot."},"attachments":{"anyOf":[{"items":{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Uploaded attachment URLs."},"page_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"string"}],"title":"Page Url","description":"Browser URL where the report was created."},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent","description":"Browser user agent string."},"screen_size":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Screen Size","description":"Viewport dimensions captured in the browser."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Optional client timestamp retained for compatibility."}},"type":"object","required":["report_type","title","description","page_url"],"title":"UserReportCreateRequest","description":"Request body for creating a user report.\n\nAttributes:\n    report_type: Report category selected in the frontend.\n    title: Short summary generated from the description.\n    description: Full report body provided by the user.\n    selected_element: Optional DOM snapshot for highlighted elements.\n    attachments: Optional uploaded attachment URLs.\n    page_url: Browser URL where the report was filed.\n    user_agent: Browser user agent string.\n    screen_size: Browser viewport dimensions.\n    created_at: Client timestamp preserved for backward compatibility."},"UserReportCreateResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the report was created."},"report_id":{"type":"string","title":"Report Id","description":"Persisted report UUID."}},"type":"object","required":["success","report_id"],"title":"UserReportCreateResponse","description":"Response after persisting a user report."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WorkspaceMetrics":{"properties":{"window":{"type":"string","enum":["24h","7d","30d","90d","all"],"title":"Window","description":"Echo of the rolling window used to compute the rollup. One of ``24h``, ``7d``, ``30d``, ``90d``, ``all``.","default":"24h"},"inference_count":{"type":"integer","title":"Inference Count","description":"Number of inference rows in the selected window for the team.","default":0},"inference_count_previous":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inference Count Previous","description":"Inference count for the window immediately preceding the current one (equal length). For ``window='all'`` both windows are unbounded, so this equals ``inference_count``. Drives the trend arrow."},"inference_count_all_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inference Count All Time","description":"All-time inference count for the team with no time window."},"error_count":{"type":"integer","title":"Error Count","description":"Inferences in the selected window with status = 'failed'.","default":0},"avg_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Latency Ms","description":"Average latency over the selected window, or null when no latency was recorded."},"p99_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Latency Ms","description":"p99 latency in milliseconds over the selected window, computed via ``percentile_cont(0.99) WITHIN GROUP (ORDER BY latency_ms)``."},"median_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Latency Ms","description":"Median (p50) latency in milliseconds over the selected window."},"p99_latency_ms_previous":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Latency Ms Previous","description":"p99 latency for the preceding window of equal length. For ``window='all'`` both windows are unbounded, so this equals ``p99_latency_ms``. Drives the latency trend arrow on the KPI grid."},"spend_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend Usd","description":"Workspace spend in USD over the selected window, summed across all models the team called. Null when pricing is unavailable for every called model."},"spend_previous_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend Previous Usd","description":"Workspace spend for the preceding window of equal length. For ``window='all'`` both windows are unbounded, so this equals ``spend_usd``."},"spend_per_1k_calls_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spend Per 1K Calls Usd","description":"Average cost per 1,000 inferences over the selected window."},"open_issue_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Open Issue Count","description":"Count of inferences in the selected window where ``llmaj_verdict = 'incorrect'`` OR ``human_verdict = 'incorrect'``."},"last_inference_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Inference At","description":"Most recent inference ``created_at`` observed in the selected window, or null."}},"type":"object","title":"WorkspaceMetrics","description":"Workspace-wide metrics for the monitoring page KPI grid.\n\nAggregates every inference belonging to the **requesting team** over a\nrolling window selected by the caller (``window``). The previous-window\nfields are computed against the immediately preceding window of equal\nlength so the UI can render trend deltas; for ``window=\"all\"`` both\nwindows are unbounded so each ``*_previous`` field equals its current\ncounterpart and the UI hides the resulting zero deltas.\n``inference_count_all_time`` is independent of the window.\n\nTeam scoping is enforced via RLS on ``public.inferences``; this is\n**not** a cross-tenant fleet rollup."},"_SandboxFailRequest":{"properties":{"error_message":{"type":"string","maxLength":4096,"title":"Error Message"}},"type":"object","required":["error_message"],"title":"_SandboxFailRequest","description":"Final failure report from the sandbox."},"_SandboxLogRequest":{"properties":{"line":{"type":"string","maxLength":8192,"title":"Line","description":"Log line body (timestamp added server-side)."}},"type":"object","required":["line"],"title":"_SandboxLogRequest","description":"Single log line submitted by the sandbox."},"_SandboxPartialResultsRequest":{"properties":{"deliverables_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deliverables Json"},"final_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Report"},"curation_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Curation Report"},"error_message":{"type":"string","maxLength":4096,"title":"Error Message"}},"type":"object","required":["error_message"],"title":"_SandboxPartialResultsRequest","description":"Best-effort save of in-flight files when the container is interrupted."},"_SandboxPhaseRequest":{"properties":{"phase":{"type":"string","maxLength":64,"title":"Phase","description":"Phase identifier, e.g. ``analyzing``."}},"type":"object","required":["phase"],"title":"_SandboxPhaseRequest","description":"High-level progress phase update."},"_SandboxWorkspaceFilesRequest":{"properties":{"deliverables_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deliverables Json"},"final_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Report"},"curation_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Curation Report"}},"type":"object","title":"_SandboxWorkspaceFilesRequest","description":"Partial workspace files synced from the sandbox while the run is running."},"schemas__inference__ChatMessage":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role","description":"Message role: 'system', 'user', or 'assistant'"},"content":{"type":"string","minLength":1,"title":"Content","description":"Message content text"}},"type":"object","required":["role","content"],"title":"ChatMessage","description":"Single message in a chat conversation.\n\nMatches the Qwen chat format used for decoder dataset validation."},"schemas__openai_compat__ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"}},"type":"object","required":["role"],"title":"ChatMessage","description":"A single chat message.\n\n``content`` accepts either a plain string or a list of content blocks\n(e.g. ``[{\"type\": \"text\", ...}, {\"type\": \"image_url\", ...}]``) so that\nmultimodal/vision payloads can pass through to upstream providers."}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Pioneer API key supplied in the X-API-Key header."},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Supabase access token or Pioneer API key supplied as a Bearer token."}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}