{"openapi":"3.1.0","info":{"title":"Tokaroo Public API","version":"1.0.0","description":"One key for optimized routing through Max, Pro, Auto, Fast, and Basic. Concrete serving routes and private settlement data remain internal.","license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://api.tokaroo.com","description":"Production"}],"tags":[{"name":"OpenAI-compatible"},{"name":"Anthropic-compatible"},{"name":"Gemini-compatible"},{"name":"Multimodal"},{"name":"Catalog"},{"name":"Account"}],"paths":{"/v1/chat/completions":{"post":{"tags":["OpenAI-compatible"],"summary":"Create a routed chat completion","operationId":"createChatCompletion","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/HarnessRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"Completion or server-sent event stream","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/responses":{"post":{"tags":["OpenAI-compatible"],"summary":"Create a routed Responses result","operationId":"createResponse","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/HarnessRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}},"responses":{"200":{"description":"Response or server-sent event stream","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/messages":{"post":{"tags":["Anthropic-compatible"],"summary":"Create a routed Anthropic Messages result","operationId":"createMessage","security":[{"anthropicApiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"anthropic-version","in":"header","required":true,"schema":{"type":"string","default":"2023-06-01"}},{"$ref":"#/components/parameters/HarnessRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicRequest"}}}},"responses":{"200":{"description":"Message or server-sent event stream","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/messages/count_tokens":{"post":{"tags":["Anthropic-compatible"],"summary":"Count Anthropic Messages input tokens","operationId":"countMessageTokens","security":[{"anthropicApiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicRequest"}}}},"responses":{"200":{"description":"Token count","content":{"application/json":{"schema":{"type":"object","required":["input_tokens"],"properties":{"input_tokens":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1beta/models/{model}:generateContent":{"post":{"tags":["Gemini-compatible"],"summary":"Generate routed Gemini content","operationId":"generateContent","security":[{"geminiApiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ModelPath"},{"$ref":"#/components/parameters/HarnessRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiRequest"}}}},"responses":{"200":{"description":"Generated content","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1beta/models/{model}:streamGenerateContent":{"post":{"tags":["Gemini-compatible"],"summary":"Stream routed Gemini content","operationId":"streamGenerateContent","security":[{"geminiApiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ModelPath"},{"$ref":"#/components/parameters/HarnessRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiRequest"}}}},"responses":{"200":{"description":"Server-sent event stream","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/embeddings":{"post":{"tags":["Multimodal"],"summary":"Create optimized text embeddings","operationId":"createEmbeddings","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"Embedding vectors","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/images/generations":{"post":{"tags":["Multimodal"],"summary":"Generate images with optimized routing","operationId":"generateImages","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRequest"}}}},"responses":{"200":{"description":"Generated image data","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/audio/speech":{"post":{"tags":["Multimodal"],"summary":"Synthesize speech","operationId":"createSpeech","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"Generated audio","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"audio/mpeg":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/audio/transcriptions":{"post":{"tags":["Multimodal"],"summary":"Transcribe audio","operationId":"createTranscription","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","model"],"properties":{"file":{"type":"string","contentEncoding":"binary"},"model":{"$ref":"#/components/schemas/TokarooModel"},"language":{"type":"string"}}}}}},"responses":{"200":{"description":"Transcription","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"}},"additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/videos":{"post":{"tags":["Multimodal"],"summary":"Start optimized video generation","operationId":"generateVideo","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoRequest"}}}},"responses":{"200":{"description":"Opaque video job","headers":{"x-tokaroo-trace-id":{"description":"Opaque request identifier.","schema":{"type":"string"}},"x-tokaroo-requested-model":{"description":"Requested Tokaroo model.","schema":{"$ref":"#/components/schemas/TokarooModel"}},"x-tokaroo-cost":{"description":"Customer charge in USD.","schema":{"type":"number"}},"x-tokaroo-input-tokens":{"description":"Recorded input tokens.","schema":{"type":"integer"}},"x-tokaroo-output-tokens":{"description":"Recorded output tokens.","schema":{"type":"integer"}},"x-tokaroo-latency-ms":{"description":"End-to-end latency in milliseconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJob"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/BillingRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/videos/{id}":{"get":{"tags":["Multimodal"],"summary":"Read video generation status","operationId":"getVideo","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Video job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJob"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Video job not found"}}}},"/v1/videos/{id}/content":{"get":{"tags":["Multimodal"],"summary":"Download completed video content","operationId":"downloadVideo","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Generated video","content":{"video/mp4":{"schema":{"type":"string","contentEncoding":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Video job not found"},"409":{"description":"Video is not ready"}}}},"/v1/models":{"get":{"tags":["Account"],"summary":"List Tokaroo model IDs","operationId":"listModels","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tokaroo models","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/pricing":{"get":{"tags":["Account"],"summary":"Read aggregate routing coverage and quality methodology","operationId":"getPricingSummary","security":[],"responses":{"200":{"description":"Aggregate public summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingSummary"}}}}}}},"/v1/catalog":{"get":{"tags":["Catalog"],"summary":"List the complete researched model universe and provider-published reference prices","operationId":"getModelCatalog","security":[],"responses":{"200":{"description":"Public model catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalog"}}}}}}},"/v1/balance":{"get":{"tags":["Account"],"summary":"Read the prepaid balance","operationId":"getBalance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/usage":{"get":{"tags":["Account"],"summary":"List customer-safe usage records","operationId":"listUsage","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Usage records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Tokaroo API key"},"anthropicApiKey":{"type":"apiKey","in":"header","name":"x-api-key"},"geminiApiKey":{"type":"apiKey","in":"header","name":"x-goog-api-key"}},"parameters":{"HarnessRef":{"name":"x-tokaroo-harness-ref","in":"header","required":false,"description":"Optional published harness profile ID.","schema":{"type":"string"}},"ModelPath":{"name":"model","in":"path","required":true,"schema":{"$ref":"#/components/schemas/TokarooModel"}}},"responses":{"BadRequest":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BillingRequired":{"description":"Positive prepaid balance required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limit reached","headers":{"retry-after":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"No compatible route currently available","headers":{"retry-after":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"TokarooModel":{"type":"string","enum":["max","pro","auto","fast","basic"]},"Error":{"type":"object","additionalProperties":true,"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"code":{"type":"string"}}},"Message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{}}]},"tool_call_id":{"type":"string"}},"additionalProperties":true},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"messages":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Message"}},"stream":{"type":"boolean","default":false},"temperature":{"type":"number"},"max_tokens":{"type":"integer","minimum":1},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_choice":{},"response_format":{"type":"object","additionalProperties":true}},"additionalProperties":true},"ChatCompletionResponse":{"type":"object","required":["id","object","model","choices"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"created":{"type":"integer"},"model":{"$ref":"#/components/schemas/TokarooModel"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"$ref":"#/components/schemas/TokenUsage"}}},"ResponsesRequest":{"type":"object","required":["model","input"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{}}]},"instructions":{"type":"string"},"stream":{"type":"boolean","default":false},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_choice":{},"max_output_tokens":{"type":"integer","minimum":1}},"additionalProperties":true},"ResponsesResponse":{"type":"object","required":["id","object","model","output"],"properties":{"id":{"type":"string"},"object":{"const":"response"},"status":{"type":"string"},"model":{"$ref":"#/components/schemas/TokarooModel"},"output":{"type":"array","items":{}},"output_text":{"type":"string"},"usage":{"$ref":"#/components/schemas/ResponsesUsage"}},"additionalProperties":true},"AnthropicRequest":{"type":"object","required":["model","max_tokens","messages"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"max_tokens":{"type":"integer","minimum":1},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":true}},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{}}]},"stream":{"type":"boolean","default":false},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_choice":{},"temperature":{"type":"number"}},"additionalProperties":true},"AnthropicResponse":{"type":"object","required":["id","type","model","content"],"properties":{"id":{"type":"string"},"type":{"const":"message"},"role":{"const":"assistant"},"model":{"$ref":"#/components/schemas/TokarooModel"},"content":{"type":"array","items":{"type":"object","additionalProperties":true}},"stop_reason":{"type":["string","null"]},"usage":{"type":"object","additionalProperties":true}},"additionalProperties":true},"GeminiRequest":{"type":"object","required":["contents"],"properties":{"contents":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":true}},"systemInstruction":{"type":"object","additionalProperties":true},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}},"generationConfig":{"type":"object","additionalProperties":true}},"additionalProperties":true},"GeminiResponse":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","additionalProperties":true}},"usageMetadata":{"type":"object","additionalProperties":true}},"additionalProperties":true},"EmbeddingRequest":{"type":"object","required":["model","input"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"encoding_format":{"enum":["float","base64"],"default":"float"},"dimensions":{"type":"integer","minimum":1,"maximum":3072,"default":1536}}},"EmbeddingResponse":{"type":"object","required":["object","data","model"],"properties":{"object":{"const":"list"},"model":{"$ref":"#/components/schemas/TokarooModel"},"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"$ref":"#/components/schemas/TokenUsage"}}},"ImageRequest":{"type":"object","required":["model","prompt"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"prompt":{"type":"string"},"n":{"type":"integer","minimum":1,"maximum":10,"default":1},"size":{"type":"string","default":"1024x1024"},"quality":{"enum":["low","medium","high","auto"],"default":"medium"}}},"SpeechRequest":{"type":"object","required":["model","input"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"input":{"type":"string"},"voice":{"type":"string","default":"alloy"},"response_format":{"enum":["mp3","opus","aac","flac","wav","pcm"],"default":"mp3"},"speed":{"type":"number","minimum":0.25,"maximum":4}}},"VideoRequest":{"type":"object","required":["model","prompt"],"properties":{"model":{"$ref":"#/components/schemas/TokarooModel"},"prompt":{"type":"string"},"seconds":{"type":"integer","minimum":1,"maximum":12,"default":8},"size":{"type":"string","default":"720p"},"aspect_ratio":{"enum":["16:9","9:16"]}}},"VideoJob":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","description":"Opaque Tokaroo job ID."},"status":{"enum":["processing","completed","failed"]},"url":{"type":"string"}}},"TokenUsage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}},"ResponsesUsage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","owned_by"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"owned_by":{"const":"tokaroo"}}}}}},"PricingSummary":{"type":"object","required":["object","model_count","provider_count","currency","collection","modes"],"properties":{"object":{"const":"tokaroo_pricing_summary"},"catalog_status":{"enum":["ok","unavailable"]},"researched_at":{"type":["string","null"],"format":"date-time"},"model_count":{"type":"integer"},"provider_count":{"type":"integer"},"providers":{"type":"array","items":{"type":"string"}},"currency":{"const":"usd"},"collection":{"const":"prepaid_usage"},"modes":{"type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"$ref":"#/components/schemas/TokarooModel"},"quality_floor_ratio":{"type":["number","null"]}}}},"quality_evidence":{"type":"object","additionalProperties":true}}},"PublishedModelPrice":{"type":"object","required":["currency","input_per_1m","output_per_1m","source_url","observed_at"],"properties":{"currency":{"enum":["usd","cad"]},"input_per_1m":{"type":["number","null"]},"output_per_1m":{"type":["number","null"]},"source_url":{"type":"string","format":"uri"},"observed_at":{"type":"string","format":"date-time"}}},"CatalogModel":{"type":"object","required":["id","name","provider","capabilities","context_window","published_pricing"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"context_window":{"type":"integer"},"published_pricing":{"oneOf":[{"$ref":"#/components/schemas/PublishedModelPrice"},{"type":"null"}]}}},"ModelCatalog":{"type":"object","required":["object","model_count","provider_count","providers","data"],"properties":{"object":{"const":"tokaroo_model_catalog"},"researched_at":{"type":["string","null"],"format":"date-time"},"model_count":{"type":"integer"},"provider_count":{"type":"integer"},"providers":{"type":"array","items":{"type":"string"}},"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}}}},"Balance":{"type":"object","required":["balance_usd","currency"],"properties":{"balance_usd":{"type":"number"},"currency":{"const":"usd"}}},"UsageRecord":{"type":"object","required":["id","requested_model","request_type","input_tokens","output_tokens","charged_usd","created_at"],"properties":{"id":{"type":"string"},"trace_id":{"type":["string","null"]},"requested_model":{"$ref":"#/components/schemas/TokarooModel"},"request_type":{"type":"string"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"charged_usd":{"type":"number"},"latency_ms":{"type":["integer","null"]},"created_at":{"type":"string","format":"date-time"}}},"UsageList":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageRecord"}},"has_more":{"type":"boolean"}}}}}}