{"openapi":"3.1.0","info":{"title":"Xava Inference API","version":"1.0.0","description":"OpenAI-compatible API for text, image, video, audio and embedding models, at the model makers' list prices. In x_pricing, list_usd is the list price everyone pays and elite_usd the price for Elite accounts. Model ids are provider/model. Docs: https://www.zinf.ai/docs"},"servers":[{"url":"https://www.zinf.ai"}],"externalDocs":{"url":"https://www.zinf.ai/docs","description":"Xava Inference docs"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key (xk_live_...)."}},"schemas":{"BuybackToken":{"type":"string","description":"x402 callers only (API-key calls use the account's buyback token): the eligible Solana token mint this call's buyback goes to. Default $XINF."},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type"]},"request_id":{"type":"string"}}},"Message":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["role"],"additionalProperties":true},"ChatRequest":{"type":"object","properties":{"model":{"type":"string","examples":["openai/gpt-5.4"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"stream":{"type":"boolean"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"tools":{"type":"array","items":{"type":"object"}},"response_format":{"type":"object"}},"required":["model","messages"],"additionalProperties":true},"ChatResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"$ref":"#/components/schemas/Message"},"finish_reason":{"type":["string","null"]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"EmbeddingsRequest":{"type":"object","properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":256}]},"encoding_format":{"enum":["float","base64"]}},"required":["model","input"]},"EmbeddingsResponse":{"type":"object","properties":{"object":{"const":"list"},"model":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"embedding":{"oneOf":[{"type":"array","items":{"type":"number"}},{"type":"string"}]}}}},"usage":{"type":"object"}}},"ImageRequest":{"type":"object","properties":{"model":{"type":"string","examples":["black-forest-labs/flux-1-schnell"]},"prompt":{"type":"string"},"n":{"type":"integer","minimum":1,"maximum":4},"size":{"type":"string","examples":["1024x1024"]},"response_format":{"enum":["url","b64_json"]},"buyback_token":{"$ref":"#/components/schemas/BuybackToken"}},"required":["model","prompt"],"additionalProperties":true},"ImageResponse":{"type":"object","properties":{"created":{"type":"integer"},"expires_at":{"type":"integer","description":"unix seconds when the file is deleted (24 hours after creation); the URL then answers 410 Gone"},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"b64_json":{"type":"string"},"expires_at":{"type":"integer","description":"unix seconds when the file is deleted (24 hours after creation); the URL then answers 410 Gone"}}}}}},"MediaRequest":{"type":"object","properties":{"model":{"type":"string","examples":["pruna/p-video"]},"input":{"type":"object","additionalProperties":true,"description":"the model's parameters, e.g. {prompt, duration, resolution}"},"buyback_token":{"$ref":"#/components/schemas/BuybackToken"}},"required":["model","input"]},"MediaResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"media.generation"},"created":{"type":"integer"},"model":{"type":"string"},"expires_at":{"type":"integer","description":"unix seconds when the file is deleted (24 hours after creation); the URL then answers 410 Gone"},"output":{"type":"object","additionalProperties":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"content_type":{"type":"string"},"bytes":{"type":"integer"},"expires_at":{"type":"integer","description":"unix seconds when the file is deleted (24 hours after creation); the URL then answers 410 Gone"}}}}}},"Upload":{"type":"object","properties":{"id":{"type":"string","description":"upl_...: pass it in a model's file parameter"},"object":{"const":"upload"},"url":{"type":["string","null"],"format":"uri","description":"signed, time-limited link (null once gone)"},"mime":{"type":"string"},"kind":{"enum":["image","video","audio"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","description":"unix seconds when the file is deleted (24 hours after creation); the URL then answers 410 Gone"},"status":{"enum":["pending","active","expired","deleted"]},"cost_usd":{"type":"string","description":"the Reference storage charge"}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"model"},"owned_by":{"type":"string"},"name":{"type":"string"},"type":{"enum":["text","image","video","audio","embeddings","other"]},"endpoint":{"type":"string"},"context_length":{"type":"integer"},"x_elite_discount_bps":{"type":"integer","description":"the model's Elite discount off the list price, bps"},"x_pricing":{"type":"object","additionalProperties":{"type":"object","properties":{"unit":{"type":"string"},"list_usd":{"type":"string","description":"List price: the model maker's own price, what everyone pays (USD per unit)."},"elite_usd":{"type":"string","description":"Elite price, for Elite accounts (USD per unit)."}}}}}},"X402PaymentRequired":{"type":"object","description":"x402 v2 PaymentRequired","properties":{"x402Version":{"const":2},"error":{"type":"string"},"resource":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"const":"exact"},"network":{"type":"string","examples":["solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"]},"asset":{"type":"string","description":"USDC mint"},"amount":{"type":"string","description":"USDC base units (6 decimals)"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object","properties":{"feePayer":{"type":"string"},"memo":{"type":"string"},"paymentFlow":{"const":"upfront"}}}}}}}}}},"paths":{"/v1/chat/completions":{"post":{"summary":"Chat completion","description":"OpenAI chat completions for every text model; `stream: true` returns SSE ending with a usage chunk. API key only.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages":{"post":{"summary":"Anthropic Messages","description":"Anthropic Messages format for Anthropic models (x-api-key also accepted).","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses":{"post":{"summary":"Responses","description":"OpenAI Responses format for OpenAI models.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/embeddings":{"post":{"summary":"Embeddings","description":"OpenAI embeddings. API key only.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsResponse"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/images/generations":{"post":{"summary":"Generate images","description":"OpenAI images shape. Priced per image (see the model's x_pricing).","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRequest"}}}},"responses":{"200":{"description":"Generated. Files are served from this origin under /media/ and deleted 24 hours after creation (expires_at, unix seconds); an expired URL answers 410 Gone.","headers":{"x-request-id":{"schema":{"type":"string"}},"x-xm-cost-usd":{"schema":{"type":"string"},"description":"what this request cost you"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageResponse"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media/generations":{"post":{"summary":"Generate video, audio or other media","description":"Any media model: {model, input}. Priced per output unit (second of video, character or minute of audio, ...).","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaRequest"}}}},"responses":{"200":{"description":"Generated. Files are served from this origin under /media/ and deleted 24 hours after creation (expires_at, unix seconds); an expired URL answers 410 Gone.","headers":{"x-request-id":{"schema":{"type":"string"}},"x-xm-cost-usd":{"schema":{"type":"string"},"description":"what this request cost you"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}},"400":{"description":"Invalid request (bad body, unsupported model for this endpoint).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance. Top up in the dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached for this key; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No capacity for this model right now; honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/uploads":{"post":{"summary":"Upload a reference file","description":"Raw body (Content-Length required, up to 95 MB) or multipart/form-data `file`; or JSON {bytes, mime} to start a multipart upload (up to 200 MB). The type is sniffed from the bytes. Charged once as Reference storage for 24 hours; deleted 24 hours after upload. Pass the returned `id` (upl_...) in any model's file parameter.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"integer"},"mime":{"type":"string"}},"required":["bytes","mime"]}}}},"responses":{"200":{"description":"The upload (or a pending multipart upload with part_urls + complete_url)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"402":{"description":"Balance too low for the storage charge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"File too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List this account's uploads of the last 24 hours","responses":{"200":{"description":"Uploads","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Upload"}}}}}}}}}},"/v1/uploads/{id}":{"get":{"summary":"Get one upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"404":{"description":"Unknown upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Expired or deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an upload now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"const":true}}}}}}}}},"/v1/models":{"get":{"summary":"List models","security":[],"responses":{"200":{"description":"The catalog","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}}}}},"/v1/models/{id}":{"get":{"summary":"Get one model","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"provider/model; the slash is part of the path"}],"responses":{"200":{"description":"The model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"404":{"description":"Unknown model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}