{"openapi":"3.1.0","info":{"title":"Astralane Inference API","version":"0.1.0","description":"Supported subsets are documented explicitly. Runtime validation also enforces relationships between fields, wallet limits and routing restrictions."},"servers":[{"url":"https://api.astralane.ai"}],"paths":{"/v1/chat/completions":{"post":{"summary":"Chat completions with text and tools","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","maxLength":128},"description":"Duplicate keys return 409; response bodies are not stored."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"prompt_cache_key":{"type":"string","minLength":1,"maxLength":64},"model":{"type":"string","minLength":1,"maxLength":128},"stream":{"default":false,"type":"boolean"},"temperature":{"type":"number","minimum":0,"maximum":2},"routing":{"type":"object","properties":{"cache_affinity":{"default":true,"type":"boolean"},"policy":{"default":"balanced","type":"string","enum":["cheapest","fastest","balanced","quality","reliable","highest_margin","verified_only"]},"allowed_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"blocked_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"regions":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"zdr":{"default":false,"type":"boolean"},"max_cost_usd":{"type":"string","maxLength":24,"pattern":"^(0|[1-9]\\d*)(\\.\\d{1,6})?$"},"min_quality":{"default":1,"type":"integer","minimum":1,"maximum":5}},"additionalProperties":false},"zdr":{"type":"boolean"},"messages":{"minItems":1,"maxItems":128,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"default":null,"anyOf":[{"type":"string","maxLength":750000},{"type":"null"}]},"name":{"type":"string","maxLength":64},"tool_call_id":{"type":"string","maxLength":200},"tool_calls":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"arguments":{"type":"string","maxLength":250000}},"required":["name","arguments"],"additionalProperties":false}},"required":["id","type","function"],"additionalProperties":false}}},"required":["role"],"additionalProperties":false}},"max_tokens":{"type":"integer","minimum":1,"maximum":16384},"max_completion_tokens":{"type":"integer","minimum":1,"maximum":16384},"tools":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"},"description":{"type":"string","maxLength":5000},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"type":"boolean"}},"required":["name","parameters"],"additionalProperties":false}},"required":["type","function"],"additionalProperties":false}},"tool_choice":{"type":"string","enum":["auto","none","required"]},"reasoning_effort":{"type":"string","enum":["low","medium","high"]},"n":{"type":"number","const":1},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"],"additionalProperties":false}},"required":["model","messages"],"additionalProperties":false}}}},"responses":{"200":{"description":"JSON completion or incremental SSE. Final metadata includes platform.billing; monetary amounts are decimal USD strings."},"400":{"description":"Invalid or unsupported input"},"401":{"description":"Invalid API key"},"402":{"description":"Insufficient available funds"},"403":{"description":"Scope, model, privacy, IP or funding restriction"},"409":{"description":"Idempotency conflict or existing request"},"429":{"description":"Rate, concurrency or budget limit"},"502":{"description":"Upstream error"},"503":{"description":"No eligible route, coordination unavailable, exposure cap, or settlement_pending. A completed request with settlement_pending must not be retried blindly; inspect request history."},"504":{"description":"Request deadline exceeded"}}}},"/v1/responses":{"post":{"summary":"Text-only compatibility subset; unsupported fields are rejected","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","maxLength":128},"description":"Duplicate keys return 409; response bodies are not stored."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"prompt_cache_key":{"type":"string","minLength":1,"maxLength":64},"model":{"type":"string","minLength":1,"maxLength":128},"stream":{"default":false,"type":"boolean"},"temperature":{"type":"number","minimum":0,"maximum":2},"routing":{"type":"object","properties":{"cache_affinity":{"default":true,"type":"boolean"},"policy":{"default":"balanced","type":"string","enum":["cheapest","fastest","balanced","quality","reliable","highest_margin","verified_only"]},"allowed_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"blocked_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"regions":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"zdr":{"default":false,"type":"boolean"},"max_cost_usd":{"type":"string","maxLength":24,"pattern":"^(0|[1-9]\\d*)(\\.\\d{1,6})?$"},"min_quality":{"default":1,"type":"integer","minimum":1,"maximum":5}},"additionalProperties":false},"zdr":{"type":"boolean"},"input":{"anyOf":[{"type":"string","maxLength":750000},{"minItems":1,"maxItems":128,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant"]},"content":{"anyOf":[{"type":"string","maxLength":750000},{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"input_text"},"text":{"type":"string","maxLength":750000}},"required":["type","text"],"additionalProperties":false}}]}},"required":["role","content"],"additionalProperties":false}}]},"instructions":{"type":"string","maxLength":100000},"max_output_tokens":{"default":1024,"type":"integer","minimum":1,"maximum":16384},"store":{"type":"boolean","const":false}},"required":["model","input"],"additionalProperties":false}}}},"responses":{"200":{"description":"JSON completion or incremental SSE. Final metadata includes platform.billing; monetary amounts are decimal USD strings."},"400":{"description":"Invalid or unsupported input"},"401":{"description":"Invalid API key"},"402":{"description":"Insufficient available funds"},"403":{"description":"Scope, model, privacy, IP or funding restriction"},"409":{"description":"Idempotency conflict or existing request"},"429":{"description":"Rate, concurrency or budget limit"},"502":{"description":"Upstream error"},"503":{"description":"No eligible route, coordination unavailable, exposure cap, or settlement_pending. A completed request with settlement_pending must not be retried blindly; inspect request history."},"504":{"description":"Request deadline exceeded"}}}},"/v1/messages":{"post":{"summary":"Text-only compatibility subset; unsupported fields are rejected","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","maxLength":128},"description":"Duplicate keys return 409; response bodies are not stored."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"prompt_cache_key":{"type":"string","minLength":1,"maxLength":64},"model":{"type":"string","minLength":1,"maxLength":128},"stream":{"default":false,"type":"boolean"},"temperature":{"type":"number","minimum":0,"maximum":2},"routing":{"type":"object","properties":{"cache_affinity":{"default":true,"type":"boolean"},"policy":{"default":"balanced","type":"string","enum":["cheapest","fastest","balanced","quality","reliable","highest_margin","verified_only"]},"allowed_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"blocked_providers":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"regions":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"zdr":{"default":false,"type":"boolean"},"max_cost_usd":{"type":"string","maxLength":24,"pattern":"^(0|[1-9]\\d*)(\\.\\d{1,6})?$"},"min_quality":{"default":1,"type":"integer","minimum":1,"maximum":5}},"additionalProperties":false},"zdr":{"type":"boolean"},"system":{"anyOf":[{"type":"string","maxLength":750000},{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","maxLength":750000}},"required":["type","text"],"additionalProperties":false}}]},"messages":{"minItems":1,"maxItems":128,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"anyOf":[{"type":"string","maxLength":750000},{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","maxLength":750000}},"required":["type","text"],"additionalProperties":false}}]}},"required":["role","content"],"additionalProperties":false}},"max_tokens":{"type":"integer","minimum":1,"maximum":16384}},"required":["model","messages","max_tokens"],"additionalProperties":false}}}},"responses":{"200":{"description":"JSON completion or incremental SSE. Final metadata includes platform.billing; monetary amounts are decimal USD strings."},"400":{"description":"Invalid or unsupported input"},"401":{"description":"Invalid API key"},"402":{"description":"Insufficient available funds"},"403":{"description":"Scope, model, privacy, IP or funding restriction"},"409":{"description":"Idempotency conflict or existing request"},"429":{"description":"Rate, concurrency or budget limit"},"502":{"description":"Upstream error"},"503":{"description":"No eligible route, coordination unavailable, exposure cap, or settlement_pending. A completed request with settlement_pending must not be retried blindly; inspect request history."},"504":{"description":"Request deadline exceeded"}}}},"/v1/models":{"get":{"summary":"/v1/models","security":[],"responses":{"200":{"description":"Database-backed JSON response"}}}},"/v1/models/supply":{"get":{"summary":"/v1/models/supply","security":[],"responses":{"200":{"description":"Database-backed JSON response"}}}},"/v1/usage/requests":{"get":{"summary":"/v1/usage/requests","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Database-backed JSON response"}}}},"/v1/usage/daily":{"get":{"summary":"/v1/usage/daily","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Database-backed JSON response"}}}},"/v1/account/balance":{"get":{"summary":"/v1/account/balance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Database-backed JSON response"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}}}