{"openapi":"3.1.0","info":{"title":"TokForge","version":"0.1.0"},"paths":{"/api/v1/jobs":{"get":{"tags":["jobs"],"summary":"List Jobs","operationId":"list_jobs_api_v1_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["jobs"],"summary":"Create Job","operationId":"create_job_api_v1_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job","operationId":"get_job_api_v1_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/cancel":{"post":{"tags":["jobs"],"summary":"Cancel Job","operationId":"cancel_job_api_v1_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/retry":{"post":{"tags":["jobs"],"summary":"Retry Job","operationId":"retry_job_api_v1_jobs__job_id__retry_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs":{"get":{"tags":["runs"],"summary":"List Runs","operationId":"list_runs_api_v1_runs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["runs"],"summary":"Create Run","operationId":"create_run_api_v1_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get Run","operationId":"get_run_api_v1_runs__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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["runs"],"summary":"Patch Run","operationId":"patch_run_api_v1_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/PatchRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations":{"post":{"tags":["allocations"],"summary":"Create Allocation","operationId":"create_allocation_api_v1_allocations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAllocationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}/activate":{"post":{"tags":["allocations"],"summary":"Activate Allocation","operationId":"activate_allocation_api_v1_allocations__allocation_id__activate_post","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateAllocationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}/renew":{"post":{"tags":["allocations"],"summary":"Renew Allocation","operationId":"renew_allocation_api_v1_allocations__allocation_id__renew_post","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}/consumption":{"post":{"tags":["allocations"],"summary":"Report Consumption","operationId":"report_consumption_api_v1_allocations__allocation_id__consumption_post","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}/complete":{"post":{"tags":["allocations"],"summary":"Complete Allocation","operationId":"complete_allocation_api_v1_allocations__allocation_id__complete_post","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteAllocationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}/release":{"post":{"tags":["allocations"],"summary":"Release Allocation","operationId":"release_allocation_api_v1_allocations__allocation_id__release_post","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseAllocationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/allocations/{allocation_id}":{"get":{"tags":["allocations"],"summary":"Get Allocation","operationId":"get_allocation_api_v1_allocations__allocation_id__get","parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"string","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/corpora":{"get":{"tags":["inventory"],"summary":"Get Corpora","operationId":"get_corpora_api_v1_corpora_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/corpora/{corpus}":{"get":{"tags":["inventory"],"summary":"Get Corpus","operationId":"get_corpus_api_v1_corpora__corpus__get","parameters":[{"name":"corpus","in":"path","required":true,"schema":{"type":"string","title":"Corpus"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/shards":{"get":{"tags":["inventory"],"summary":"Get Shards","operationId":"get_shards_api_v1_shards_get","parameters":[{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory":{"get":{"tags":["inventory"],"summary":"Get Inventory","operationId":"get_inventory_api_v1_inventory_get","parameters":[{"name":"dataset","in":"query","required":true,"schema":{"type":"string","title":"Dataset"}},{"name":"config","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/reconcile":{"post":{"tags":["inventory"],"summary":"Reconcile","operationId":"reconcile_api_v1_admin_reconcile_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/stats":{"get":{"tags":["inventory"],"summary":"Stats","operationId":"stats_api_v1_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivateAllocationRequest":{"properties":{"account":{"type":"string","title":"Account"},"attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attempt Id"}},"type":"object","required":["account"],"title":"ActivateAllocationRequest"},"CompleteAllocationRequest":{"properties":{"account":{"type":"string","title":"Account"},"attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attempt Id"},"steps_completed":{"type":"integer","title":"Steps Completed","default":0},"tokens_trained":{"type":"integer","title":"Tokens Trained","default":0},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["account"],"title":"CompleteAllocationRequest"},"ConsumptionEvent":{"properties":{"path":{"type":"string","title":"Path"},"event":{"type":"string","title":"Event"},"tokens_consumed":{"type":"integer","minimum":0.0,"title":"Tokens Consumed"},"step_from":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step From"},"step_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step To"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["path","event","tokens_consumed"],"title":"ConsumptionEvent"},"ConsumptionRequest":{"properties":{"account":{"type":"string","title":"Account"},"attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attempt Id"},"reported_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reported At"},"events":{"items":{"$ref":"#/components/schemas/ConsumptionEvent"},"type":"array","minItems":1,"title":"Events"}},"type":"object","required":["account","events"],"title":"ConsumptionRequest"},"CreateAllocationRequest":{"properties":{"run_id":{"type":"string","title":"Run Id"},"client":{"type":"string","title":"Client","default":"modal"},"account":{"type":"string","title":"Account"},"attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attempt Id"},"requested_tokens_override":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Requested Tokens Override"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["run_id","account"],"title":"CreateAllocationRequest"},"CreateJobRequest":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["config"],"title":"CreateJobRequest"},"CreateRunRequest":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["config"],"title":"CreateRunRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PatchRunRequest":{"properties":{"patch":{"$ref":"#/components/schemas/RunPatch"}},"type":"object","required":["patch"],"title":"PatchRunRequest"},"ReleaseAllocationRequest":{"properties":{"reason":{"type":"string","title":"Reason","default":""},"steps_completed":{"type":"integer","title":"Steps Completed","default":0}},"type":"object","title":"ReleaseAllocationRequest"},"RunPatch":{"properties":{"default_requested_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Default Requested Tokens"},"lease_ttl_s":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Lease Ttl S"},"allow_partial_reissue":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allow Partial Reissue"}},"type":"object","title":"RunPatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}