Šis puslapis dar neišverstas, todėl rodomas angliškai.
API reference
Base URL: https://api.oryvox.ai/v1
All requests are authenticated with a bearer key:
Authorization: Bearer ory_live_... (or ory_test_... for test mode)Request and response bodies are JSON.
| Method | Path | Key scope | Purpose |
|---|---|---|---|
| POST | /chat/completions | chat | OpenAI chat completions, plus ORYVOX extensions |
| POST | /responses | chat | Simplified Responses API |
| POST | /embeddings | embeddings | OpenAI embeddings |
| GET | /models | models | Routing profiles and available models |
| POST | /cache/invalidate | cache | Remove cached answers by tag, or all |
| GET | /requests | requests | Request log of the key's project |
| GET | /requests/{request_id} | requests | One request with its trace |
| POST | /requests/{request_id}/feedback | chat | Rate an answer 1-5 |
| GET | /metrics | requests | Project metrics for a period |
Keys without explicit scopes may use chat, embeddings, models and cache. A missing
scope answers 403 permission_denied.
Request headers
| Header | Effect |
|---|---|
Idempotency-Key | On /chat/completions, /responses, /embeddings: replays the stored result of an identical request (Billing). |
X-Oryvox-Session | Conversation id: sticky routing and provider-cache reuse across turns. |
X-Oryvox-Trace-Id | Groups requests into one trace (max 40 chars). |
X-Oryvox-Parent-Span | Parent span of this request's root span (max 24 chars). |
X-Oryvox-Cache: off | Skip the response cache for this request. |
X-Oryvox-Cache-Scope | Share cached answers only within this scope (e.g. a tenant or user id). |
Response headers
| Header | Value |
|---|---|
X-Oryvox-Request-Id | req_... (also on streams) |
X-Oryvox-Model | Selected model (non-streaming chat and responses) |
X-Oryvox-Provider | Provider (sandbox in test mode, cache for cache hits) |
X-Oryvox-Cache | exact, semantic or miss |
X-Oryvox-Api-Version | API release date, e.g. 2026-10-04 (every response) |
Idempotent-Replayed | true when a stored result was replayed |
Deprecation, Sunset, Link | On deprecated endpoints (Versioning) |
ORYVOX extensions
/chat/completions and /responses accept these extra body fields:
| Field | Type | Description |
|---|---|---|
routing | object | {"mode": "economy" | "balanced" | "quality" | "max", "min_quality": number}. See Models and routing. |
max_cost | number | Cap for this request in USD (model cost). Models that could exceed it are not used. |
optimization | object | {"mode", "preserve", "do_not_compress", "documents", "fields"}. See Token optimization. |
metadata | object | Hints: task, priority (realtime | batch | normal), customer_tier, step, session_id. |
tags | string[] | Up to 20 labels, recorded with the request (e.g. faq, realtime, batch). |
cache | object | {"mode": "bypass" | "default", "refresh": true, "tags": [...]}. See Cache. |
oryvox | object | step, workflow_id, workflow_budget, versions (prompt, tools, knowledge, memory), cache.tags, session_id, agent. See Agents. |
user | string | End-user id; personal answers are cached per user only. |
Every successful completion and response carries an oryvox object:
| Field | Type | Description |
|---|---|---|
request_id | string | Id in the request log (req_...). |
selected_model | string | The model that answered. |
provider | string | The provider that served it (cache for a cache hit, sandbox in test mode). |
cost | number | Model cost of the request, USD, before the ORYVOX markup (Billing). |
saved | number | Baseline cost minus cost, USD. |
cache | null | "exact" | "semantic" | Whether the answer came from the cache (similarity on semantic hits). |
fallbacks | integer | How many fallbacks were used (0 = first choice answered). |
test | boolean | true for simulated test-mode answers. |
POST /chat/completions
OpenAI chat completions format.
curl https://api.oryvox.ai/v1/chat/completions \
-H "Authorization: Bearer $ORYVOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "oryvox-balanced",
"messages": [
{"role": "system", "content": "You are concise."},
{"role": "user", "content": "What is a CDN?"}
],
"max_tokens": 200,
"routing": {"mode": "balanced"},
"max_cost": 0.01
}'| Field | Type | Required | Description |
|---|---|---|---|
model | string | no | A routing profile (oryvox-auto (default), oryvox-fast, oryvox-balanced, oryvox-quality, oryvox-max, oryvox-reasoning, oryvox-code) or a model id such as anthropic/claude-sonnet-5.5. |
messages | array | yes | OpenAI messages (system, developer, user, assistant, tool). Content may be a string or parts (text, image_url). |
tools, tool_choice | no | OpenAI function tools. See Tool calling. | |
response_format | object | no | {"type":"json_object"} or {"type":"json_schema", ...}. See Structured outputs. |
max_tokens, temperature, top_p, stop | no | As in OpenAI. | |
stream | boolean | no | Server-sent events. See Streaming. |
| extensions | no | See above. |
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1790000000,
"model": "openai/gpt-5-mini",
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "A CDN is..."}, "finish_reason": "stop"}
],
"usage": {"prompt_tokens": 24, "completion_tokens": 41, "total_tokens": 65},
"oryvox": {"request_id": "req_8f2k...", "selected_model": "openai/gpt-5-mini", "provider": "openai",
"cost": 0.000092, "saved": 0.00071, "cache": null, "fallbacks": 0}
}With "stream": true: chat.completion.chunk lines (the last chunk carries usage), then
data: {"object":"oryvox.summary","oryvox":{...}}, then data: [DONE]. An error after the
stream started arrives as data: {"error": {...}} followed by data: [DONE].
Errors: 400 invalid_request, 400 blocked_by_policy, 401, 402 budget_exceeded,
402 insufficient_credits, 403, 404 model_not_found, 409 conflict,
422 idempotency_mismatch, 429 rate_limited, 502, 503 no_model_available,
503 provider_unavailable, 504 timeout. See Errors.
POST /responses
A simplified Responses API on the same pipeline: send input, read output_text.
curl https://api.oryvox.ai/v1/responses \
-H "Authorization: Bearer $ORYVOX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6c1d9f0e-order-42" \
-d '{
"model": "oryvox-auto",
"instructions": "Answer in one sentence.",
"input": "Why is the sky blue?",
"max_output_tokens": 120,
"metadata": {"task": "faq", "priority": "realtime"}
}'| Field | Type | Required | Description |
|---|---|---|---|
model | string | no | Routing profile or model id (default oryvox-auto). |
input | string | array | yes | A string, or {"role": "system" | "developer" | "user" | "assistant", "content": string | parts}; parts are input_text / output_text / text and input_image (image_url). |
instructions | string | no | System instructions. |
max_output_tokens, temperature, top_p | no | Output limit and sampling. | |
tools, tool_choice | no | Function tools (OpenAI chat format). | |
stream | boolean | no | Stream typed events. |
| extensions | no | See above. |
{
"id": "resp_...",
"object": "response",
"created_at": 1790000000,
"model": "google/gemini-3-flash",
"status": "completed",
"output_text": "Air molecules scatter short blue wavelengths more than red ones.",
"output": [
{"type": "message", "id": "msg_...", "status": "completed", "role": "assistant",
"content": [{"type": "output_text", "text": "Air molecules scatter...", "annotations": []}]}
],
"usage": {"input_tokens": 21, "output_tokens": 14, "total_tokens": 35, "input_tokens_details": {"cached_tokens": 0}},
"oryvox": {"request_id": "req_...", "selected_model": "google/gemini-3-flash", "provider": "google", "cost": 0.00002, "saved": 0.0004, "cache": null, "fallbacks": 0}
}Tool calls appear in output as
{"type": "function_call", "id": "fc_...", "call_id": "...", "name": "...", "arguments": "{...}", "status": "completed"}.
Streaming ("stream": true) sends event: / data: pairs:
event: response.created
data: {"type":"response.created","response":{"id":"resp_...","object":"response","created_at":1790000000,"model":"oryvox-auto","status":"in_progress"}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Air molecules","item_id":"resp_..."}
event: response.completed
data: {"type":"response.completed","response":{ ...full response, including "oryvox"... }}On failure: event: error / data: {"type":"error","error":{...}}. Errors as for
/chat/completions.
POST /embeddings
OpenAI embeddings format. model defaults to openai/text-embedding-3-small.
curl https://api.oryvox.ai/v1/embeddings \
-H "Authorization: Bearer $ORYVOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/text-embedding-3-small", "input": ["first text", "second text"]}'| Field | Type | Required | Description |
|---|---|---|---|
input | string | string[] | yes | Text(s) to embed. |
model | string | no | An embedding model id. |
dimensions | integer | no | Output dimensions, where the model supports it. |
encoding_format | string | no | float (default) or base64. |
{
"object": "list",
"data": [{"object": "embedding", "index": 0, "embedding": [0.0123, -0.0456]}],
"model": "openai/text-embedding-3-small",
"usage": {"prompt_tokens": 4, "total_tokens": 4}
}Errors: 404 model_not_found (not an embedding model), 402 insufficient_credits,
503 no_model_available, plus the auth errors. Embeddings are metered and charged like other
requests. With an ory_test_ key the vectors are simulated (deterministic, 16 dimensions) and free.
GET /models
{
"object": "list",
"data": [
{"id": "oryvox-auto", "object": "model", "owned_by": "oryvox", "created": 0, "oryvox": {"virtual": true}},
{
"id": "anthropic/claude-sonnet-5.5", "object": "model", "owned_by": "anthropic", "created": 1780000000,
"oryvox": {
"name": "Claude Sonnet 5.5", "input_price": 3.0, "output_price": 15.0, "context_window": 200000,
"tools": true, "vision": true, "json": true, "reasoning": true, "embeddings": false,
"quality": 92, "routable": true
}
}
],
"has_more": false
}Prices are USD per million tokens. Routing profiles have "virtual": true. The whole list is
returned in one page.
POST /cache/invalidate
curl https://api.oryvox.ai/v1/cache/invalidate \
-H "Authorization: Bearer $ORYVOX_API_KEY" -H "Content-Type: application/json" \
-d '{"tags": ["document:456"]}'| Field | Type | Description |
|---|---|---|
tags | string[] | Remove the project's cached answers carrying any of these tags (max 100, 120 chars each). |
all | boolean | true empties the project's response cache. |
Response: {"object": "cache.invalidation", "deleted": 12}. See Cache.
GET /requests, GET /requests/{request_id}, POST /requests/{request_id}/feedback, GET /metrics
The request log (?limit&after&model&status&workflow_id&trace_id, cursor-paginated with
has_more / last_id), one request with its trace, answer ratings
({"rating": 1-5} → {"object": "feedback", "request_id", "rating"}) and project metrics
(?period=1h|24h|7d|30d). Unknown request ids answer 404 not_found. Prompts and answers are
never returned. Full reference: Observability.
for await (const r of client.requests.list({ limit: 50 })) console.log(r.request_id);for r in client.requests.list(limit=50):
print(r.request_id)Validation errors on /cache/invalidate and /feedback answer 422 with
{"message", "errors"} (see Errors).