{"openapi":"3.1.0","info":{"title":"Platform Backend","version":"0.1.0"},"paths":{"/api/auth/verify":{"get":{"tags":["auth"],"summary":"Verify Auth","operationId":"verify_auth_api_auth_verify_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}]},"type":"object","title":"Response Verify Auth Api Auth Verify Get"}}}}}}},"/api/billing":{"get":{"tags":["billing"],"summary":"Get Billing","operationId":"get_billing_api_billing_get","parameters":[{"name":"orgId","in":"query","required":true,"schema":{"type":"string","title":"Orgid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Billing Api Billing Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/setup-intent":{"post":{"tags":["billing"],"summary":"Post Setup Intent","operationId":"post_setup_intent_api_billing_setup_intent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupIntentBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Setup Intent Api Billing Setup Intent Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/payment-method":{"post":{"tags":["billing"],"summary":"Post Payment Method","operationId":"post_payment_method_api_billing_payment_method_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Payment Method Api Billing Payment Method Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["billing"],"summary":"Delete Payment Method","operationId":"delete_payment_method_api_billing_payment_method_delete","parameters":[{"name":"orgId","in":"query","required":true,"schema":{"type":"string","title":"Orgid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Payment Method Api Billing Payment Method Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/customer":{"delete":{"tags":["billing"],"summary":"Delete Billing Customer","description":"Delete the org's Stripe customer + saved payment methods on org deletion.\n\nOwner-gated; the frontend org-delete flow calls this BEFORE removing the org row\n(the org_billing row that holds the stripe customer id cascade-deletes with the\norg). Best-effort by design: failures here are logged and surfaced but must not\nblock the rest of org teardown.","operationId":"delete_billing_customer_api_billing_customer_delete","parameters":[{"name":"orgId","in":"query","required":true,"schema":{"type":"string","title":"Orgid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Billing Customer Api Billing Customer Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/topup":{"post":{"tags":["billing"],"summary":"Post Topup","operationId":"post_topup_api_billing_topup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Topup Api Billing Topup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/auto-topup":{"put":{"tags":["billing"],"summary":"Put Auto Topup","operationId":"put_auto_topup_api_billing_auto_topup_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Put Auto Topup Api Billing Auto Topup Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/starter-credit":{"post":{"tags":["billing"],"summary":"Post Starter Credit","operationId":"post_starter_credit_api_billing_starter_credit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterCreditBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Starter Credit Api Billing Starter Credit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/promo-code":{"post":{"tags":["billing"],"summary":"Post Promo Code","description":"Redeem a promo code to credit the org's balance -- no card required.\n\nAny org member can redeem; the grant is one-per-(org, code). The code -> amount\nmapping is hard-coded in the backend (PROMO_CODES).","operationId":"post_promo_code_api_billing_promo_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoCodeBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Promo Code Api Billing Promo Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/webhook":{"post":{"tags":["billing"],"summary":"Post Webhook","operationId":"post_webhook_api_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/debit":{"post":{"tags":["billing"],"summary":"Post Debit","description":"Frontend dialog flow uses this to debit the prepaid balance (the flat run fee)\nbefore the run row is inserted. The training-agent claim path bills the same fee via\nroutes/training_internal.py (debit_for_run), not through this route.","operationId":"post_debit_api_billing_debit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebitBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Debit Api Billing Debit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/serving-usage":{"post":{"tags":["billing"],"summary":"Post Serving Usage","description":"Meter + bill a serving request's tokens (per-token at Fireworks cost + 20%).\n\nMachine-to-machine: the serving layer calls this after generating, authenticated with\nthe internal key. Debits the org's prepaid balance and records the usage row. The serving\ncaller reports fire-and-forget (at-most-once), so a dropped report under-meters rather than\ndouble-bills; the stable per-generation ``requestId`` keeps it idempotent if a retry is ever\nadded (a replay with the same id returns the original charge without debiting again).\n\nThe caller may send ``orgId`` directly, or just ``adapterId`` (the serving layer's case) —\nwe resolve the owning org from the adapter when ``orgId`` is absent.\n\nCross-tenant safety (mirrors the ``/api/sample`` BOLA hardening): the adapter has exactly one\nowning org, so whenever ``adapterId`` is present it is the AUTHORITATIVE source of the billing\norg. A client-supplied ``orgId`` may never override it — if both are given they must match, or\nwe reject (a mismatch means the caller is trying to bill another tenant for this adapter's\nusage, or vice-versa). ``orgId`` alone is honored only when no ``adapterId`` is supplied.","operationId":"post_serving_usage_api_billing_serving_usage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServingUsageBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Serving Usage Api Billing Serving Usage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/training-usage":{"post":{"tags":["billing"],"summary":"Post Training Usage","description":"Charge a managed flash training run its pre-flight cost estimate.\n\nMachine-to-machine: the flash control plane calls this at run submit, authenticated with\nthe SUBMITTING USER'S freesolo API key (the same key it already verifies). The backend\nresolves the org from that key, debits the org's prepaid balance for the estimate, and\nrecords the charge. A 402 (insufficient balance) blocks the run client-side. ``runId``\nmakes the report idempotent (a retried submit bills the run once).\n\nThis is separate from — and does not affect — the flat custom-model run fee\n(``debit_for_run``), which is the platform training-agent product.","operationId":"post_training_usage_api_billing_training_usage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingUsageBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Training Usage Api Billing Training Usage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/training-usage/precheck":{"post":{"tags":["billing"],"summary":"Post Training Usage Precheck","description":"Verify-only budget pre-flight before a managed flash run is allocated a GPU.\n\nMachine-to-machine: the flash control plane calls this at submit (internal key + explicit org\nid) with the run's flash.cost estimate. Returns 402 when the org can't cover the estimate (no\nbalance and no card+auto-topup), so the control plane rejects the run BEFORE any GPU is\nallocated -- instead of letting it train to completion and only then failing to bill. This\nmoves no money: the real debit still happens at completion from the actual ``cost_usd``.","operationId":"post_training_usage_precheck_api_billing_training_usage_precheck_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingPrecheckBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Training Usage Precheck Api Billing Training Usage Precheck Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/training-usage/internal":{"post":{"tags":["billing"],"summary":"Post Internal Training Usage","description":"Charge a completed managed Flash training run using an explicit org id.\n\nMachine-to-machine: the Flash control plane calls this after a run reaches ``done``,\nauthenticated with the operator internal key. The run is still charged idempotently by\n``runId``; the only difference from the user-key route is that the org is supplied by\nFlash's persisted non-secret billing context instead of being derived from a user API key.","operationId":"post_internal_training_usage_api_billing_training_usage_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalTrainingUsageBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Internal Training Usage Api Billing Training Usage Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/training-cost":{"post":{"tags":["billing"],"summary":"Post Training Cost","description":"Record a training run's realized provider cost (COGS) for estimator accuracy.\n\nMachine-to-machine: the flash control plane's reconciliation job calls this after a run\nfinishes, authenticated with the operator internal key (NOT a user key -- this is COGS, not\na customer charge). Upserts ``training_run_cost`` keyed by ``runId``; the org and the charged\nestimate are joined in later (the ``training_cost_accuracy`` view), so no org id is needed\nhere. Idempotent: a re-pulled run (provider billing lags) records once.","operationId":"post_training_cost_api_billing_training_cost_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingCostBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Training Cost Api Billing Training Cost Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/codex-logs":{"post":{"tags":["codex-logs"],"summary":"Create Codex Log","operationId":"create_codex_log_api_codex_logs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodexLogCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodexLogCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/evals/runs":{"post":{"tags":["evals"],"summary":"Upload Eval Run","operationId":"upload_eval_run_api_evals_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/projects/validate/internal":{"post":{"tags":["flash"],"summary":"Post Flash Project Validate","description":"Validate an active project within an explicitly supplied organization.\n\nReturns the project's slug as well as its id: the control plane needs it to build the\n``<org-slug>/<project-slug>/<name>`` environment slug, and this is the call it already makes\nbefore publishing, so carrying the slug here avoids a second round trip.","operationId":"post_flash_project_validate_api_flash_projects_validate_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashProjectValidateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"type":"object","title":"Response Post Flash Project Validate Api Flash Projects Validate Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/environments/hub/provision/internal":{"post":{"tags":["flash"],"summary":"Post Environment Hub Provision","description":"Run one bounded pass of seeded environment hub provisioning.\n\n`orgId` narrows the pass to one organization so a member-triggered run cannot advance the\nretry backoff on other organizations' rows. the cron sweep omits it and runs globally.","operationId":"post_environment_hub_provision_api_flash_environments_hub_provision_internal_post","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"orgId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Orgid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Post Environment Hub Provision Api Flash Environments Hub Provision Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/environments/internal":{"post":{"tags":["flash"],"summary":"Post Flash Environment Publish","description":"Persist a Flash Hub environment after the control plane publishes it.","operationId":"post_flash_environment_publish_api_flash_environments_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashEnvironmentPublishBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Flash Environment Publish Api Flash Environments Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["flash"],"summary":"Delete Flash Environment Mirror","description":"Drop a Flash Hub environment mirror row when the control plane deletes it.\n\nCalled by the Flash control plane after it removes the environment from Hub\nstorage. This must NOT call Flash back, to avoid a delete loop.","operationId":"delete_flash_environment_mirror_api_flash_environments_internal_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashEnvironmentDeleteBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Flash Environment Mirror Api Flash Environments Internal Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/environments/validate/internal":{"post":{"tags":["flash"],"summary":"Post Flash Environment Validate","description":"Validate an environment's project association without mutating it.","operationId":"post_flash_environment_validate_api_flash_environments_validate_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashEnvironmentValidateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Post Flash Environment Validate Api Flash Environments Validate Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/environments/use/internal":{"post":{"tags":["flash"],"summary":"Post Flash Environment Use","description":"Record that a Flash run referenced a Hub environment slug.","operationId":"post_flash_environment_use_api_flash_environments_use_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashEnvironmentUseBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Post Flash Environment Use Api Flash Environments Use Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/runs/internal":{"post":{"tags":["flash"],"summary":"Post Flash Training Run","description":"Persist the latest status for a managed Flash training run.","operationId":"post_flash_training_run_api_flash_runs_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashTrainingRunUpsertBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Post Flash Training Run Api Flash Runs Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/runs/checkpoints/internal":{"post":{"tags":["flash"],"summary":"Post Flash Training Checkpoint","description":"Persist a checkpoint/artifact snapshot for a managed Flash training run.","operationId":"post_flash_training_checkpoint_api_flash_runs_checkpoints_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashTrainingCheckpointUpsertBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Post Flash Training Checkpoint Api Flash Runs Checkpoints Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flash/events/internal":{"post":{"tags":["flash"],"summary":"Post Flash Product Event","description":"Record a product-analytics event reported by the flash control plane.","operationId":"post_flash_product_event_api_flash_events_internal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlashProductEventBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Post Flash Product Event Api Flash Events Internal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects":{"get":{"tags":["projects"],"summary":"Get Projects","operationId":"get_projects_api_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Projects Api Projects Get"}}}}}},"post":{"tags":["projects"],"summary":"Post Project","operationId":"post_project_api_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreateBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"type":"object","title":"Response Post Project Api Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get Project By Id","operationId":"get_project_by_id_api_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":{"type":"object","additionalProperties":true,"title":"Response Get Project By Id Api Projects  Project Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs":{"post":{"tags":["runs"],"summary":"Create Run","operationId":"create_run_api_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}":{"patch":{"tags":["runs"],"summary":"Update Run Route","operationId":"update_run_route_api_runs__run_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}/wandb":{"post":{"tags":["runs"],"summary":"Link Wandb","operationId":"link_wandb_api_runs__run_id__wandb_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WandbLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WandbLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/internal/checkpoints":{"post":{"tags":["runs-internal"],"summary":"Record Checkpoints","operationId":"record_checkpoints_api_runs_internal_checkpoints_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCheckpointsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Checkpoints Api Runs Internal Checkpoints Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["runs-internal"],"summary":"Get Checkpoints","operationId":"get_checkpoints_api_runs_internal_checkpoints_get","parameters":[{"name":"runId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":300,"title":"Runid"}},{"name":"orgId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":300,"title":"Orgid"}},{"name":"projectId","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Projectid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Checkpoints Api Runs Internal Checkpoints Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sample":{"post":{"tags":["sample"],"summary":"Sample Route","operationId":"sample_route_api_sample_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/serving/authorize":{"post":{"tags":["serving"],"summary":"Post Serving Authorize","description":"Authorize an external serving chat request: the user's API key's org must own the adapter.\n\nAuth model: a user authenticates the serving endpoint with THEIR OWN Freesolo API key and may\nonly reach adapters their org owns. The shared internal key is a separate master credential that\ncan reach ANY adapter — trusted server-to-server callers (the control plane, the ``/api/sample``\nproxy) present it and bypass this route entirely at the serving layer. This endpoint exists only\nfor the user-key path.\n\nMachine-to-machine: the serving layer calls this (authenticated with the internal key) before\ngenerating, passing the caller's Freesolo API key and the requested adapter id. We resolve the\nkey's org and the adapter's owning org and require they match.\n\nThe adapter→org mapping (``hosted_lora_adapters.org_id``) is the AUTHORITATIVE source of the\nowning tenant — the same source ``/billing/serving-usage`` bills against, so an authorized chat\nis always attributable. A multi-LoRA endpoint serves adapters owned by different orgs on shared\ncapacity, routed by the ``model`` field, so a valid key is not enough — its org must own *that\nspecific adapter*.\n\nBase models: a served base-model id (``token_pricing.is_priced_base_model``) is a no-LoRA serve\nreachable by ANY valid key — no ownership check — and the returned ``orgId`` is the CALLER's org\nso the serving layer bills the caller (there is no adapter owner).\n\nReturns 200 ``{orgId}`` on success; 401 for an invalid key, 404 for an unknown/unattributed\nadapter, 403 when the key's org does not own the (non-base) adapter.","operationId":"post_serving_authorize_api_serving_authorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServingAuthorizeBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Serving Authorize Api Serving Authorize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/serving/teardown":{"post":{"tags":["serving"],"summary":"Post Serving Teardown","description":"Undeploy an org's live serving adapters (called on org deletion).\n\nOwner-gated: the frontend org-delete flow calls this with the deleting owner's\nsession BEFORE removing the org row, so the live Modal adapters are stopped and\nthe GPU capacity reclaimed (otherwise serving keeps billing after the org is\ngone, since the db cascade only removes the adapter rows, not the running app).\nBest-effort per adapter; returns the per-adapter teardown counts.","operationId":"post_serving_teardown_api_serving_teardown_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServingTeardownBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Serving Teardown Api Serving Teardown Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/traces/projects":{"get":{"tags":["traces"],"summary":"List Projects","operationId":"list_projects_api_traces_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceProjectsResponse"}}}}}}},"/api/traces/export":{"get":{"tags":["traces"],"summary":"Export Traces","operationId":"export_traces_api_traces_export_get","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","description":"project whose traces to export","title":"Project Id"},"description":"project whose traces to export"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"one of records, prompts, raw","default":"records","title":"Format"},"description":"one of records, prompts, raw"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TracesExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs":{"post":{"tags":["training"],"summary":"Enqueue Job","operationId":"enqueue_job_api_training_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TrainingTracerRequest"},{"$ref":"#/components/schemas/TrainingDraftRequest"},{"$ref":"#/components/schemas/TrainingOptimizeRequest"},{"$ref":"#/components/schemas/TrainingRunRequest"}],"discriminator":{"propertyName":"action","mapping":{"tracer":"#/components/schemas/TrainingTracerRequest","draft":"#/components/schemas/TrainingDraftRequest","optimize":"#/components/schemas/TrainingOptimizeRequest","training":"#/components/schemas/TrainingRunRequest"}},"title":"Payload"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingAgentQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["training"],"summary":"List Jobs","operationId":"list_jobs_api_training_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"orgId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Orgid"}},{"name":"projectId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Projectid"}},{"name":"trainingTaskId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Trainingtaskid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingAgentJobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/stop":{"post":{"tags":["training"],"summary":"Stop Job","operationId":"stop_job_api_training_jobs__job_id__stop_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/TrainingAgentStopRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingAgentQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/secrets":{"post":{"tags":["training"],"summary":"Upsert Secrets","operationId":"upsert_secrets_api_training_secrets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingOrgSecretsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingOrgSecretsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}":{"get":{"tags":["training"],"summary":"Get Job","operationId":"get_job_api_training_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"orgId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Orgid"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"default":"","title":"Projectid"}},{"name":"trainingTaskId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"default":"","title":"Trainingtaskid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingAgentQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/claim":{"post":{"tags":["training-internal"],"summary":"Claim Jobs","operationId":"claim_jobs_api_training_internal_jobs_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalClaimJobsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Claim Jobs Api Training Internal Jobs Claim Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/{job_id}":{"get":{"tags":["training-internal"],"summary":"Get Job","operationId":"get_job_api_training_internal_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":{"type":"object","additionalProperties":true,"title":"Response Get Job Api Training Internal Jobs  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/succeeded":{"post":{"tags":["training-internal"],"summary":"Mark Succeeded","operationId":"mark_succeeded_api_training_internal_jobs_succeeded_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobSucceededRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Mark Succeeded Api Training Internal Jobs Succeeded Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/blocked":{"post":{"tags":["training-internal"],"summary":"Mark Blocked","operationId":"mark_blocked_api_training_internal_jobs_blocked_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobBlockedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Mark Blocked Api Training Internal Jobs Blocked Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/user-stopped":{"post":{"tags":["training-internal"],"summary":"Mark User Stopped","operationId":"mark_user_stopped_api_training_internal_jobs_user_stopped_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobUserStoppedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Mark User Stopped Api Training Internal Jobs User Stopped Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/failed":{"post":{"tags":["training-internal"],"summary":"Mark Failed","operationId":"mark_failed_api_training_internal_jobs_failed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobFailedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Mark Failed Api Training Internal Jobs Failed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/heartbeat":{"post":{"tags":["training-internal"],"summary":"Heartbeat Job","operationId":"heartbeat_job_api_training_internal_jobs_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobIdRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Heartbeat Job Api Training Internal Jobs Heartbeat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/live-status":{"post":{"tags":["training-internal"],"summary":"Update Live Status","operationId":"update_live_status_api_training_internal_jobs_live_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalJobLiveStatusRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Update Live Status Api Training Internal Jobs Live Status Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/jobs/requeue-stale":{"post":{"tags":["training-internal"],"summary":"Requeue Stale Jobs","operationId":"requeue_stale_jobs_api_training_internal_jobs_requeue_stale_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Requeue Stale Jobs Api Training Internal Jobs Requeue Stale Post"}}}}}}},"/api/training/internal/jobs/requeue-interrupted":{"post":{"tags":["training-internal"],"summary":"Requeue Interrupted Jobs","operationId":"requeue_interrupted_jobs_api_training_internal_jobs_requeue_interrupted_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalWorkerIdRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Requeue Interrupted Jobs Api Training Internal Jobs Requeue Interrupted Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/codex-usage":{"post":{"tags":["training-internal"],"summary":"Report Codex Usage","operationId":"report_codex_usage_api_training_internal_codex_usage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalCodexUsageReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"integer"},"type":"object","title":"Response Report Codex Usage Api Training Internal Codex Usage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/optimizer-timelines/sync":{"post":{"tags":["training-internal"],"summary":"Sync Timeline","operationId":"sync_timeline_api_training_internal_optimizer_timelines_sync_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalOptimizerTimelineSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sync Timeline Api Training Internal Optimizer Timelines Sync Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/internal/codex-logs":{"get":{"tags":["training-internal"],"summary":"List Logs","operationId":"list_logs_api_training_internal_codex_logs_get","parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Org Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Logs Api Training Internal Codex Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["training-internal"],"summary":"Create Log","operationId":"create_log_api_training_internal_codex_logs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalCodexLogCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Log Api Training Internal Codex Logs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/wandb":{"get":{"tags":["wandb"],"summary":"Wandb Run Route","operationId":"wandb_run_route_api_wandb_get","parameters":[{"name":"entity","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Entity"}},{"name":"project","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Project"}},{"name":"runId","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":500,"title":"Runid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Wandb Run Route Api Wandb Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/completions":{"post":{"tags":["recording-proxy"],"summary":"Chat Completions","operationId":"chat_completions_v1_chat_completions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/healthz":{"get":{"tags":["system"],"summary":"Healthcheck","operationId":"healthcheck_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Healthcheck Healthz Get"}}}}}}}},"components":{"schemas":{"AutoTopupBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"enabled":{"type":"boolean","title":"Enabled"},"thresholdCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Thresholdcents"},"amountCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amountcents"}},"type":"object","required":["orgId","enabled"],"title":"AutoTopupBody"},"CheckpointItem":{"properties":{"step":{"type":"integer","minimum":0.0,"title":"Step"},"subfolder":{"type":"string","maxLength":300,"minLength":1,"title":"Subfolder"}},"type":"object","required":["step","subfolder"],"title":"CheckpointItem"},"CodexLogCreateRequest":{"properties":{"content":{"type":"string","maxLength":50000,"minLength":1,"title":"Content"}},"additionalProperties":false,"type":"object","required":["content"],"title":"CodexLogCreateRequest"},"CodexLogCreateResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"codex_log_id":{"type":"string","title":"Codex Log Id"}},"type":"object","required":["codex_log_id"],"title":"CodexLogCreateResponse"},"DebitBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"runId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runid"}},"type":"object","required":["orgId"],"title":"DebitBody"},"EvalCasePayload":{"properties":{"case_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Case Id"},"input":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"actual":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Success"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"latency_ms":{"anyOf":[{"type":"integer","maximum":2147483647.0,"minimum":0.0},{"type":"null"}],"title":"Latency Ms"},"total_tokens":{"anyOf":[{"type":"integer","maximum":2147483647.0,"minimum":0.0},{"type":"null"}],"title":"Total Tokens"}},"type":"object","title":"EvalCasePayload","description":"One graded case, as `flash env eval --upload` reports it."},"EvalRunUploadRequest":{"properties":{"project_id":{"type":"string","minLength":1,"title":"Project Id"},"suite_name":{"type":"string","maxLength":200,"minLength":1,"title":"Suite Name"},"environment_reference":{"type":"string","maxLength":512,"minLength":1,"title":"Environment Reference"},"model":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Model"},"status":{"type":"string","enum":["completed","failed"],"title":"Status","default":"completed"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"cases":{"items":{"$ref":"#/components/schemas/EvalCasePayload"},"type":"array","maxItems":5000,"title":"Cases"}},"type":"object","required":["project_id","suite_name","environment_reference"],"title":"EvalRunUploadRequest"},"EvalRunUploadResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"eval_run_id":{"type":"string","title":"Eval Run Id"},"total_cases":{"type":"integer","title":"Total Cases"},"passed_cases":{"type":"integer","title":"Passed Cases"},"graded_cases":{"type":"integer","title":"Graded Cases"},"errored_cases":{"type":"integer","title":"Errored Cases","default":0},"mean_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Score"}},"type":"object","required":["eval_run_id","total_cases","passed_cases","graded_cases"],"title":"EvalRunUploadResponse"},"FlashEnvironmentDeleteBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"slug":{"type":"string","maxLength":512,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$","title":"Slug"}},"type":"object","required":["orgId","projectId","slug"],"title":"FlashEnvironmentDeleteBody"},"FlashEnvironmentPublishBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"slug":{"type":"string","maxLength":512,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$","title":"Slug"},"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"hubRepo":{"type":"string","minLength":1,"title":"Hubrepo","default":"freesolo-co/environment-hub"},"hubRef":{"type":"string","minLength":1,"title":"Hubref","default":"main"},"hubPath":{"type":"string","minLength":1,"title":"Hubpath"},"packageSha256":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Packagesha256"},"publishedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publishedbyuserid"},"apiKeyId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apikeyid"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["orgId","projectId","slug","name","hubPath"],"title":"FlashEnvironmentPublishBody"},"FlashEnvironmentUseBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"slug":{"type":"string","maxLength":512,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$","title":"Slug"},"runId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Runid"}},"type":"object","required":["orgId","projectId","slug"],"title":"FlashEnvironmentUseBody"},"FlashEnvironmentValidateBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"slug":{"type":"string","maxLength":512,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$","title":"Slug"}},"type":"object","required":["orgId","projectId","slug"],"title":"FlashEnvironmentValidateBody"},"FlashProductEventBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"event":{"type":"string","maxLength":64,"minLength":1,"title":"Event"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Userid"},"properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Properties"}},"type":"object","required":["orgId","event"],"title":"FlashProductEventBody","description":"A product-analytics event reported by the flash control plane.\n\nCovers control-plane actions that never otherwise touch this backend (e.g.\nan adapter export, which is an hf-to-hf copy inside flash). The event name\nis validated against an allowlist in the route so this can't be used to\nforge arbitrary analytics."},"FlashProjectValidateBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"}},"type":"object","required":["orgId","projectId"],"title":"FlashProjectValidateBody"},"FlashTrainingCheckpointUpsertBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"runId":{"type":"string","maxLength":128,"minLength":1,"title":"Runid"},"checkpointId":{"type":"string","maxLength":256,"minLength":1,"title":"Checkpointid"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase"},"adapterRef":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adapterref"},"artifactPath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifactpath"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatedat"}},"type":"object","required":["orgId","projectId","runId","checkpointId"],"title":"FlashTrainingCheckpointUpsertBody"},"FlashTrainingRunUpsertBody":{"properties":{"orgId":{"type":"string","minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"runId":{"type":"string","maxLength":128,"minLength":1,"title":"Runid"},"status":{"type":"string","maxLength":64,"minLength":1,"title":"Status"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Userid"},"apiKeyId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apikeyid"},"environmentSlug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environmentslug"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"algorithm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Algorithm"},"phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase"},"gpuType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gputype"},"costUsd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Costusd"},"realizedCostUsd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Realizedcostusd"},"adapterRef":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adapterref"},"artifactsDir":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifactsdir"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"spec":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Spec"},"deployment":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deployment"},"lastHeartbeat":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Lastheartbeat"},"gpuStatus":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Gpustatus"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatedat"}},"type":"object","required":["orgId","projectId","runId","status"],"title":"FlashTrainingRunUpsertBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InternalClaimJobsRequest":{"properties":{"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"action":{"type":"string","enum":["draft","tracer","optimize","training"],"title":"Action"},"limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit"}},"additionalProperties":false,"type":"object","required":["worker_id","action","limit"],"title":"InternalClaimJobsRequest"},"InternalCodexAccountUsage":{"properties":{"account_label":{"type":"string","maxLength":200,"minLength":1,"title":"Account Label"},"limit_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Limit Id"},"limit_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Limit Name"},"plan_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Plan Type"},"primary_used_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Primary Used Percent"},"primary_window_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Primary Window Minutes"},"primary_resets_at":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Primary Resets At"},"secondary_used_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Secondary Used Percent"},"secondary_window_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Secondary Window Minutes"},"secondary_resets_at":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Secondary Resets At"},"credits_balance":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Credits Balance"},"error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["account_label"],"title":"InternalCodexAccountUsage"},"InternalCodexLogCreateRequest":{"properties":{"org_id":{"type":"string","maxLength":100,"minLength":1,"title":"Org Id"},"training_agent_job_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Training Agent Job Id"},"content":{"type":"string","maxLength":50000,"minLength":1,"title":"Content"}},"additionalProperties":false,"type":"object","required":["org_id","content"],"title":"InternalCodexLogCreateRequest"},"InternalCodexUsageReportRequest":{"properties":{"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"accounts":{"items":{"$ref":"#/components/schemas/InternalCodexAccountUsage"},"type":"array","maxItems":200,"title":"Accounts"}},"additionalProperties":false,"type":"object","required":["worker_id","accounts"],"title":"InternalCodexUsageReportRequest"},"InternalJobBlockedRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"result":{"additionalProperties":true,"type":"object","title":"Result"},"error":{"type":"string","maxLength":20000,"minLength":1,"title":"Error"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id","error"],"title":"InternalJobBlockedRequest"},"InternalJobFailedRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"error":{"type":"string","maxLength":20000,"minLength":1,"title":"Error"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id","error"],"title":"InternalJobFailedRequest"},"InternalJobIdRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id"],"title":"InternalJobIdRequest"},"InternalJobLiveStatusRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"live_status":{"type":"string","maxLength":2000,"minLength":1,"title":"Live Status"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id","live_status"],"title":"InternalJobLiveStatusRequest"},"InternalJobSucceededRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"result":{"additionalProperties":true,"type":"object","title":"Result"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id"],"title":"InternalJobSucceededRequest"},"InternalJobUserStoppedRequest":{"properties":{"job_id":{"type":"string","maxLength":100,"minLength":1,"title":"Job Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"},"result":{"additionalProperties":true,"type":"object","title":"Result"},"error":{"type":"string","maxLength":20000,"title":"Error","default":"Training agent job stopped by user"}},"additionalProperties":false,"type":"object","required":["job_id","project_id","worker_id"],"title":"InternalJobUserStoppedRequest"},"InternalOptimizerTimelineSyncRequest":{"properties":{"org_id":{"type":"string","maxLength":100,"minLength":1,"title":"Org Id"},"project_id":{"type":"string","maxLength":100,"minLength":1,"title":"Project Id"},"training_task_id":{"type":"string","maxLength":100,"minLength":1,"title":"Training Task Id"},"repository_full_name":{"type":"string","maxLength":300,"minLength":1,"title":"Repository Full Name"},"tracker_path":{"type":"string","maxLength":1000,"minLength":1,"title":"Tracker Path"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"additionalProperties":false,"type":"object","required":["org_id","project_id","training_task_id","repository_full_name","tracker_path"],"title":"InternalOptimizerTimelineSyncRequest"},"InternalTrainingUsageBody":{"properties":{"runId":{"type":"string","maxLength":200,"minLength":1,"title":"Runid"},"costCents":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Costcents"},"gpu":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gpu"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"estimate":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Estimate"},"orgId":{"type":"string","maxLength":200,"minLength":1,"title":"Orgid"}},"type":"object","required":["runId","costCents","orgId"],"title":"InternalTrainingUsageBody"},"InternalWorkerIdRequest":{"properties":{"worker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Worker Id"}},"additionalProperties":false,"type":"object","required":["worker_id"],"title":"InternalWorkerIdRequest"},"PaymentMethodBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"paymentMethodId":{"type":"string","title":"Paymentmethodid"}},"type":"object","required":["orgId","paymentMethodId"],"title":"PaymentMethodBody"},"ProjectCreateBody":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ProjectCreateBody"},"PromoCodeBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"}},"type":"object","required":["orgId","code"],"title":"PromoCodeBody"},"RunCheckpointsBody":{"properties":{"orgId":{"type":"string","maxLength":300,"minLength":1,"title":"Orgid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"runId":{"type":"string","maxLength":300,"minLength":1,"title":"Runid"},"repoId":{"type":"string","maxLength":300,"minLength":1,"title":"Repoid"},"repoType":{"type":"string","pattern":"^(dataset|model)$","title":"Repotype","default":"dataset"},"baseModel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Basemodel"},"checkpoints":{"items":{"$ref":"#/components/schemas/CheckpointItem"},"type":"array","maxItems":1000,"minItems":1,"title":"Checkpoints"}},"type":"object","required":["orgId","projectId","runId","repoId","checkpoints"],"title":"RunCheckpointsBody"},"RunCreateRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"trainingAgentJobId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trainingagentjobid"},"projectId":{"type":"string","format":"uuid","title":"Projectid"},"trainingTaskId":{"type":"string","format":"uuid","title":"Trainingtaskid"}},"additionalProperties":true,"type":"object","required":["name","projectId","trainingTaskId"],"title":"RunCreateRequest"},"RunCreateResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"run_id":{"type":"string","title":"Run Id"}},"type":"object","required":["run_id"],"title":"RunCreateResponse"},"RunUpdateRequest":{"properties":{"projectId":{"type":"string","format":"uuid","title":"Projectid"},"trainingTaskId":{"type":"string","format":"uuid","title":"Trainingtaskid"},"status":{"anyOf":[{"type":"string","enum":["pending","running","completed","failed","cancelled"]},{"type":"null"}],"title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"additionalProperties":true,"type":"object","required":["projectId","trainingTaskId"],"title":"RunUpdateRequest"},"RunUpdateResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"run_id":{"type":"string","title":"Run Id"}},"type":"object","required":["run_id"],"title":"RunUpdateResponse"},"SampleErrorResponse":{"properties":{"error":{"type":"string","title":"Error"}},"type":"object","required":["error"],"title":"SampleErrorResponse"},"SampleRequest":{"properties":{"serveUrl":{"type":"string","maxLength":2000,"minLength":1,"title":"Serveurl"},"prompt":{"type":"string","maxLength":50000,"minLength":1,"title":"Prompt"},"systemPrompt":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Systemprompt"},"model":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Model"},"maxTokens":{"type":"integer","maximum":8192.0,"minimum":1.0,"title":"Maxtokens"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7}},"additionalProperties":false,"type":"object","required":["serveUrl","prompt","maxTokens"],"title":"SampleRequest"},"SampleResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok","default":true},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"SampleResponse"},"ServingAuthorizeBody":{"properties":{"apiKey":{"type":"string","title":"Apikey"},"adapterId":{"type":"string","title":"Adapterid"}},"additionalProperties":false,"type":"object","required":["apiKey","adapterId"],"title":"ServingAuthorizeBody"},"ServingTeardownBody":{"properties":{"orgId":{"type":"string","title":"Orgid"}},"additionalProperties":false,"type":"object","required":["orgId"],"title":"ServingTeardownBody"},"ServingUsageBody":{"properties":{"orgId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orgid"},"baseModel":{"type":"string","title":"Basemodel"},"promptTokens":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Prompttokens"},"completionTokens":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Completiontokens"},"cachedTokens":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Cachedtokens","default":0},"adapterId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adapterid"},"gpuSeconds":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Gpuseconds"},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requestid"},"engineReplicaId":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Enginereplicaid"},"servingDeploymentId":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Servingdeploymentid"},"cachedTokensReported":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cachedtokensreported"}},"type":"object","required":["baseModel","promptTokens","completionTokens"],"title":"ServingUsageBody"},"SetupIntentBody":{"properties":{"orgId":{"type":"string","title":"Orgid"}},"type":"object","required":["orgId"],"title":"SetupIntentBody"},"StarterCreditBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"tier":{"type":"string","enum":["base","card"],"title":"Tier"}},"type":"object","required":["orgId","tier"],"title":"StarterCreditBody"},"TopupBody":{"properties":{"orgId":{"type":"string","title":"Orgid"},"amountCents":{"type":"integer","minimum":1.0,"title":"Amountcents"}},"type":"object","required":["orgId","amountCents"],"title":"TopupBody"},"TraceProject":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name"],"title":"TraceProject","description":"A project a caller can export traces from."},"TraceProjectsResponse":{"properties":{"projects":{"items":{"$ref":"#/components/schemas/TraceProject"},"type":"array","title":"Projects"}},"type":"object","required":["projects"],"title":"TraceProjectsResponse"},"TracesExportResponse":{"properties":{"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"},"traces":{"type":"integer","title":"Traces"},"skipped":{"type":"integer","title":"Skipped"},"format":{"type":"string","title":"Format"}},"type":"object","required":["records","traces","skipped","format"],"title":"TracesExportResponse","description":"A project's traces in the requested shape.\n\n`format` echoes what produced `records`:\n\n- ``records``: ``{\"input\", \"output\"}`` environment records, dropping straight\n  into an environment's dataset/train.jsonl. SFT and GRPO both read these.\n- ``prompts``: ``{\"input\"}`` only, for GRPO, which samples its own\n  completions. Keeps traces whose reply never arrived, so it usually yields\n  more rows than ``records`` over the same traces.\n- ``raw``: the stored trace rows with their spans, converted by nothing.\n\n`traces` counts what was read; `skipped` is how many produced no record\n(always 0 for ``raw``)."},"TrainingAgentJobListResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok","default":true},"jobs":{"items":{"$ref":"#/components/schemas/TrainingAgentJobResponse"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"TrainingAgentJobListResponse"},"TrainingAgentJobResponse":{"properties":{"jobId":{"type":"string","title":"Jobid"},"projectId":{"type":"string","title":"Projectid"},"trainingTaskId":{"type":"string","title":"Trainingtaskid"},"action":{"type":"string","enum":["draft","tracer","optimize","training"],"title":"Action"},"status":{"type":"string","enum":["queued","running","succeeded","failed","blocked","user_stopped","cancelled"],"title":"Status"},"contractApprovedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contractapprovedat"},"contractReviewRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contractreviewrequestedat"},"contractReviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contractreviewnote"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Startedat"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finishedat"},"repoUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repourl"},"bestModelLabel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bestmodellabel"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"message":{"type":"string","title":"Message"}},"type":"object","required":["jobId","projectId","trainingTaskId","action","status","createdAt","message"],"title":"TrainingAgentJobResponse"},"TrainingAgentQueuedResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok","default":true},"job":{"$ref":"#/components/schemas/TrainingAgentJobResponse"}},"type":"object","required":["job"],"title":"TrainingAgentQueuedResponse"},"TrainingAgentStopRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"projectId":{"type":"string","maxLength":100,"minLength":1,"title":"Projectid"},"trainingTaskId":{"type":"string","maxLength":100,"minLength":1,"title":"Trainingtaskid"}},"additionalProperties":false,"type":"object","required":["projectId","trainingTaskId"],"title":"TrainingAgentStopRequest"},"TrainingCostBody":{"properties":{"runId":{"type":"string","maxLength":200,"minLength":1,"title":"Runid"},"realizedCostUsd":{"type":"number","minimum":0.0,"title":"Realizedcostusd"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"gpu":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gpu"},"costByResource":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Costbyresource"},"wallSeconds":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Wallseconds"},"costBasis":{"anyOf":[{"type":"string","pattern":"^(estimated|realized)$"},{"type":"null"}],"title":"Costbasis"},"source":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Source"}},"type":"object","required":["runId","realizedCostUsd"],"title":"TrainingCostBody"},"TrainingDraftRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"action":{"type":"string","const":"draft","title":"Action"},"projectId":{"type":"string","maxLength":100,"minLength":1,"title":"Projectid"},"trainingTaskId":{"type":"string","maxLength":100,"minLength":1,"title":"Trainingtaskid"}},"additionalProperties":false,"type":"object","required":["action","projectId","trainingTaskId"],"title":"TrainingDraftRequest"},"TrainingOptimizeRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"action":{"type":"string","const":"optimize","title":"Action"},"projectId":{"type":"string","maxLength":100,"minLength":1,"title":"Projectid"},"trainingTaskId":{"type":"string","maxLength":100,"minLength":1,"title":"Trainingtaskid"}},"additionalProperties":false,"type":"object","required":["action","projectId","trainingTaskId"],"title":"TrainingOptimizeRequest"},"TrainingOrgSecretsRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"secrets":{"additionalProperties":{"type":"string"},"type":"object","title":"Secrets"}},"additionalProperties":false,"type":"object","title":"TrainingOrgSecretsRequest"},"TrainingOrgSecretsResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok","default":true},"saved":{"items":{"type":"string"},"type":"array","title":"Saved"}},"type":"object","required":["saved"],"title":"TrainingOrgSecretsResponse"},"TrainingPrecheckBody":{"properties":{"orgId":{"type":"string","maxLength":200,"minLength":1,"title":"Orgid"},"estimateCents":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Estimatecents"}},"type":"object","required":["orgId","estimateCents"],"title":"TrainingPrecheckBody"},"TrainingRunRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"action":{"type":"string","const":"training","title":"Action"},"projectId":{"type":"string","maxLength":100,"minLength":1,"title":"Projectid"},"trainingTaskId":{"type":"string","maxLength":100,"minLength":1,"title":"Trainingtaskid"},"platformRunId":{"type":"string","maxLength":100,"minLength":1,"title":"Platformrunid"}},"additionalProperties":false,"type":"object","required":["action","projectId","trainingTaskId","platformRunId"],"title":"TrainingRunRequest"},"TrainingTracerRequest":{"properties":{"orgId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Orgid"},"action":{"type":"string","const":"tracer","title":"Action"},"sourceRepoUrl":{"type":"string","maxLength":300,"minLength":1,"title":"Sourcerepourl"},"projectId":{"type":"string","maxLength":100,"minLength":1,"title":"Projectid"},"prompt":{"type":"string","maxLength":8000,"minLength":20,"title":"Prompt"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"environmentVariables":{"additionalProperties":{"type":"string"},"type":"object","title":"Environmentvariables"}},"additionalProperties":false,"type":"object","required":["action","sourceRepoUrl","projectId","prompt"],"title":"TrainingTracerRequest","description":"The request that opens a training task.\n\nTracing leads the pipeline, so this is the only action that names the source repo\nand the user's prompt. Both are persisted onto the task, and every later stage\nreads them back from there rather than restating them."},"TrainingUsageBody":{"properties":{"runId":{"type":"string","maxLength":200,"minLength":1,"title":"Runid"},"costCents":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Costcents"},"gpu":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gpu"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"estimate":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Estimate"}},"type":"object","required":["runId","costCents"],"title":"TrainingUsageBody"},"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"},"WandbLinkRequest":{"properties":{"projectId":{"type":"string","format":"uuid","title":"Projectid"},"trainingTaskId":{"type":"string","format":"uuid","title":"Trainingtaskid"},"wandb_url":{"type":"string","maxLength":500,"minLength":1,"title":"Wandb Url"}},"additionalProperties":true,"type":"object","required":["projectId","trainingTaskId","wandb_url"],"title":"WandbLinkRequest"},"WandbLinkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"run_id":{"type":"string","title":"Run Id"},"wandb_urls":{"items":{"type":"string"},"type":"array","title":"Wandb Urls"}},"type":"object","required":["run_id","wandb_urls"],"title":"WandbLinkResponse"}}}}