OpenAI-compatible API

2026-10-22

OpenAI-compatible API

Base URL

Loading…

Get started

Loading…

Endpoints

MethodPathDescriptionSupport
POST/v1/chat/completionsCreate chat completion● Supported
POST/v1/responsesCreate a response● Supported
GET/v1/responses/{response_id}Retrieve a response● Supported
DELETE/v1/responses/{response_id}Delete a response● Supported
POST/v1/responses/{response_id}/cancelCancel a response◐ Partial
GET/v1/responses/{response_id}/input_itemsList input items● Supported
POST/v1/responses/compactCompact a response○ Unsupported
POST/v1/responses/input_tokensCount input tokens○ Unsupported
POST/v1/conversationsCreate a conversation● Supported
GET/v1/conversations/{conversation_id}Retrieve a conversation● Supported
POST/v1/conversations/{conversation_id}Update a conversation● Supported
DELETE/v1/conversations/{conversation_id}Delete a conversation● Supported
POST/v1/conversations/{conversation_id}/itemsCreate conversation items● Supported
GET/v1/conversations/{conversation_id}/itemsList conversation items● Supported
GET/v1/conversations/{conversation_id}/items/{item_id}Retrieve a conversation item● Supported
DELETE/v1/conversations/{conversation_id}/items/{item_id}Delete a conversation item● Supported
POST/v1/images/generationsCreate an image● Supported
GET/v1/modelsList models● Supported
GET/v1/models/{model}Retrieve model● Supported
POST/v1/embeddingsCreate embeddings● Supported
POST/v1/videosCreate video● Supported
GET/v1/videosList videos● Supported
GET/v1/videos/{video_id}Retrieve video● Supported
GET/v1/videos/{video_id}/contentDownload video content● Supported
DELETE/v1/videos/{video_id}Delete video● Supported
POST/v1/videos/{video_id}/remixRemix video○ Unsupported
POST/v1/audio/transcriptionsTranscribe audio● Supported
POST/v1/filesUpload a file◐ Partial
GET/v1/filesList files● Supported
GET/v1/files/{file_id}Retrieve file● Supported
DELETE/v1/files/{file_id}Delete file● Supported
GET/v1/files/{file_id}/contentRetrieve file content● Supported
POST/v1/audio/speechGenerate speech● Supported
POST/v1/images/editsEdit images● Supported

Vector stores (16 operations): create stores, attach files, manage batches and search.

Unsupported endpoints

These endpoints are unavailable under /openai/v1 and return 404. The alternatives are workflows, not equivalent endpoints.

EndpointAlternative
/v1/moderationsNo alternative endpoint
/v1/batchesCall the required model endpoint individually
/v1/fine_tuningUse an existing model from the catalog
/v1/assistantsBuild sessions with Responses and Conversations
/v1/completionsUse chat/completions
/v1/audio/translationsTranscribe with audio/transcriptions, then translate with chat/completions
/v1/uploadsUpload files with files
/v1/images/variationsSubmit an image and editing prompt with images/edits

Differences from OpenAI

  • Create chat completion:Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
  • Create a response:Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
  • Retrieve a response:Reads a stored response by ID. If it was created with store set to false we did not store it, and the read returns 404 response_not_found; after the retention period (30 days by default) the read returns the same 404.
  • Delete a response:Deletes a stored response by ID immediately. If it was created with store set to false we did not store it, and the delete returns 404 response_not_found.
  • Cancel a response:Available only for responses created with background:true and routed to a model that can generate in the background. Cancel is idempotent — repeated calls return the same terminal response. Cancelling stops us reading the upstream stream; it cannot guarantee that compute already sent upstream stops, and usage is billed for what was actually received. Calling cancel on a non-background (synchronous) response returns 404 object_not_found if the response id does not exist (not stored, expired or wrong id), or 400 native_responses_operation_unsupported if the response exists but its provider does not declare cancel support (none of the upstreams we connect declares it for synchronous responses). Neither case is the not-implemented 501.
  • List input items:Lists the input items of a stored response. Supports limit (1–100, default 20), order (asc/desc, default desc, as in the official API) and cursor pagination by item id with after; has_more / first_id / last_id match the page actually returned, so you can page through without gaps or repeats. Every item carries a server-issued id (msg_ for messages, and each of function_call / function_call_output / reasoning has its own prefix); older data stored before ids existed gets deterministic ids on read, without a destructive migration, so repeated reads with the same cursor stay stable. For a response created with previous_response_id, the list shows the full resolved input: the input and output items of the earlier responses in the chain plus the input submitted this turn; if an ancestor response was not stored on the platform (for example created with store false) or has expired, only this turn's own input is listed. If the response was created with store set to false we did not store it, and the list returns 404 response_not_found.
  • Compact a response:Compacts a response's input into a summary. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.
  • Count input tokens:Counts the tokens the request input would consume without generating content. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.
  • Create a conversation:Creates a conversation, optionally with initial items (up to 20 at a time) and metadata. Conversations are partitioned by tenant; only the creating tenant can reference it.
  • Retrieve a conversation:Reads a conversation by ID. A conversation that does not exist or belongs to another tenant returns 404 conversation_not_found.
  • Update a conversation:Updates a conversation's metadata — the whole object is replaced, not merged with the existing metadata.
  • Delete a conversation:Deletes a conversation. After deletion neither the conversation nor its items can be referenced again (including as the conversation parameter of Responses create).
  • Create conversation items:Appends items to a conversation (up to 20 at a time) and returns the items just added.
  • List conversation items:Lists a conversation's items in creation order, with limit / after / order pagination.
  • Retrieve a conversation item:Reads a single item of a conversation by ID.
  • Delete a conversation item:Deletes a single item of a conversation and returns the conversation object (not the deleted item).
  • Retrieve model:Returns the same model object as its entry in the list. Only models that declare an OpenAI API are visible; model IDs may carry slash-separated publisher prefixes. A model that does not exist or declares no OpenAI API returns 404.
  • Create embeddings:Forwarded the same way as chat completions, and usage is billed on the same account. Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
  • Create video:Generates video asynchronously: create a job, poll its status, then download the content. Billed per second of output; GET /model/v1/models exposes pricing.video_second in USD per second. Select a registered video model explicitly, for example wan2.7-t2v.
  • List videos:Lists the video jobs of your account. limit is 1–100, order is asc or desc, and after must refer to an existing job.
  • Retrieve video:Reads the job's current status and progress. Keep polling while status is queued or in_progress, inspect error when it is failed, and download the content only once it is completed. An unknown job returns 404.
  • Download video content:Downloads the video file (video, MP4) or the thumbnail (thumbnail) once the job is completed; spritesheet returns 400 and index supports 0 only. An unknown job returns 404.
  • Delete video:Deletes the job and its generated content. An unknown job returns 404.
  • Remix video:Unsupported; the call always returns 400 (invalid_request_error, message "Video remix is not supported"). Do not retry.
  • Transcribe audio:Standard request fields; unrepresentable parameters return input_not_representable.
  • Upload a file:Upload one file, up to 100 MB (104857600 bytes), using streaming multipart/form-data. Supported content-detected types: PDF; DOCX, XLSX, PPTX; PNG, JPEG, GIF, WebP; MP3, WAV, FLAC, OGG, M4A; MP4, WebM; UTF-8 JSON, NDJSON, CSV, Markdown and plain text. Purposes: user_data, assistants, vision. Other purposes and empty/unsupported/oversized files return 400. OpenAI Uploads chunking is not supported. expires_after accepts anchor created_at and seconds 3600–2592000. Only form file, purpose, expires_after[anchor] and expires_after[seconds] are accepted; any other form field or any query parameter returns 400 invalid_request_error "Unrecognized request argument supplied: <name>" with param naming it.
  • List files:Only the after, order, limit and purpose query parameters are accepted; any other returns 400 invalid_request_error "Unrecognized request argument supplied: <name>" with param naming it.

For authoritative parameter definitions, see the official OpenAI documentation.

Errors follow the OpenAI format, see errors; quotas and response headers are covered in rate limits.

Create chat completion

POST /openai/v1/chat/completions● Supported

Official OpenAI docs ↗

Request parameters

  • X-OpenRouter-Metadatastring可选○ Currently ignored

    header: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.

    Accepted but currently has no effect; the requested routing metadata is not returned.

    取值 disabledenabled
  • messagesarray必填◐ Partially supported

    List of messages for the conversation

    Text, roles, history and tool round trips work. Images have model-specific size limits. file_id accepts user_data images, text and PDF; see the [file reference guide](/en/docs/cloud/services/model/guides/files) for model support and failure handling.

    ▸ 展开子字段(12)

    元素按 role 区分(assistant / developer / system / tool / user),此处展开其中一种的形状

    • configuration_updateobject可选

      OpenRouter extension. Same as the system message `configuration_update`: changes reasoning effort from this point in the conversation onward without invalidating the prompt cache for the preceding turns.

    • contentstring | array可选

      Tool response content

    • namestring可选

      Optional name for the assistant

    • rolestring可选

      Role of the message author; always tool.

      取值 tool
    • audioobject可选

      Audio output data or reference

    • imagesarray可选

      Generated images from image generation models

    • modelstring可选

      Model that generated this assistant message

    • reasoningstring可选

      Reasoning output

    • reasoning_detailsarray可选

      Reasoning details for extended thinking models

    • refusalstring可选

      Refusal message if content was refused

    • tool_callsarray可选

      Tool calls made by the assistant

    • tool_call_idstring可选

      ID of the assistant message tool call this message responds to

  • modelstring可选

    Model to use for completion

    Primary model; optional when a nonempty models list supplies the first candidate.

  • streamboolean可选◐ Partially supported
    默认 false

    Enable streaming response

    Content and tool deltas stream; gemini-2.5-flash may omit the end sentinel and budget exhaustion may report an incorrect finish_reason.

  • temperaturenumber可选◐ Partially supported

    Sampling temperature (0-2)

    An effect was observed on deepseek-v4-flash via /openai; sampling effects on other models remain unobservable.

  • max_tokensinteger可选◐ Partially supported

    Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.

    Works on deepseek-v4-flash and glm-5.3-flash; small budgets may not take effect on qwen3.8-flash. Takes precedence over max_completion_tokens.

  • top_pnumber可选◐ Partially supported

    Nucleus sampling parameter (0-1)

    An effect was observed only on glm-5.3-flash via /model; other tested models or faces accepted it without an observed effect.

  • stopstring | array可选◐ Partially supported

    Stop sequences (up to 4)

    Works on qwen3.8-flash; deepseek-v4-flash and glm-5.3-flash may stop during reasoning and return empty content.

  • toolsarray可选

    Available tools for function calling

    Verified to take effect.

  • tool_choicestring | object可选◐ Partially supported

    Tool choice configuration

    auto works. deepseek-v4-flash ignores none/required/named functions; qwen3.8-flash rejects required/named functions in thinking mode; named selection on glm-5.3-flash is inconsistent.

    ▸ 展开子字段(2)
    • functionobject必填

      The function the model must call.

    • typestring必填

      OpenRouter server-tool type to force (e.g. `openrouter:web_search`, `web_search`, `web_search_preview`).

  • ▸ 更多参数(48)
    • response_formatobject可选◐ Partially supported

      Response format configuration

      json_object works. json_schema works on deepseek-v4-flash and qwen3.8-flash but was not honored by glm-5.3-flash.

      ▸ 展开子字段(3)

      按 type 区分(grammar / json_object / json_schema / python / text),此处展开其中一种的形状

      • typestring必填

        Always `python`. Discriminator that marks this object as a ChatFormatPythonConfig in a `type`-tagged union.

        取值 python
      • json_schemaobject必填

        JSON Schema configuration object

      • grammarstring必填

        Custom grammar for text generation

    • cache_controlobject可选

      Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.

      ▸ 展开子字段(2)
      • ttlstring可选

        Lifetime of an Anthropic-style cache breakpoint.

        取值 5m1h
      • typestring必填

        Always `ephemeral`. Discriminator that marks this object as a AnthropicCacheControlDirective in a `type`-tagged union.

        取值 ephemeral
    • debugobject可选

      Debug options for inspecting request transformations (streaming only)

      ▸ 展开子字段(1)
      • echo_upstream_bodyboolean可选○ Currently ignored

        If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode.

        Accepted but currently has no effect. Streaming requests do not echo the upstream request body.

    • frequency_penaltynumber可选◐ Partially supported

      Frequency penalty (-2.0 to 2.0)

      Some requests take effect on deepseek-v4-flash and glm-5.3-flash; qwen3.8-flash rejects some values or faces with 400.

    • image_configobject可选

      Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.

    • logit_biasobject可选

      Token logit bias adjustments

    • logprobsboolean可选◐ Partially supported

      Return log probabilities

      Works on qwen3.8-flash; deepseek-v4-flash works only via /openai and glm-5.3-flash differs between faces. gemini-2.5-flash returns 400.

    • max_completion_tokensinteger可选◐ Partially supported

      Maximum tokens in completion

      Works on deepseek-v4-flash and glm-5.3-flash; small budgets on qwen3.8-flash may be ineffective or exceed limits.

    • metadataobject可选

      Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)

    • min_pnumber可选○ Currently ignored

      Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter.

      Accepted but currently has no effect.

    • modalitiesarray可选

      Output modalities for the response. Supported values are "text", "image", and "audio".

    • modelsarray可选

      Models to use for completion

      Ordered fallback on an unknown primary, unavailable same-protocol line or upstream failure. models alone is accepted; response model and cost belong to the model that completes the request.

    • parallel_tool_callsboolean可选◐ Partially supported

      Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response.

      false works on qwen3.8-flash, is ignored by deepseek-v4-flash, and differs between faces on glm-5.3-flash.

    • pluginsarray可选◐ Partially supported

      Plugins you want to enable for this request, including their settings.

      Supports file-parser (pdf.engine native, mistral-ocr mapped to ocr, ocr, auto) and platform guardrails. Requests override account defaults but preserve locked settings. Unsupported plugins such as web, unknown engines and malformed configurations return 400 naming the field.

      ▸ 展开子字段(27)

      元素按 id 区分(auto-beta-router / auto-router / context-compression / file-parser / fusion / moderation / pareto-router / response-healing / web / web-fetch),此处展开其中一种的形状

      • allowed_modelsarray可选

        List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.

      • cost_quality_tradeoffinteger可选

        Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.

      • cost_tierstring可选

        Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.

        取值 lowmediumhighxhighmax
      • enabledboolean可选

        Set to false to disable Fusion configuration for a run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. Defaults to true.

      • excluded_modelsarray可选

        List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.

      • idstring可选

        Plugin id; always fusion.

        取值 fusion
      • pin_modelboolean可选

        When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false.

      • enginestring可选

        The compression engine to use. Defaults to "middle-out".

        取值 middle-out
      • exclude_domainsarray可选

        A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog").

      • include_domainsarray可选

        A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog").

      • max_resultsinteger可选

        Maximum number of search results to use.

      • max_usesinteger可选

        Maximum number of web fetches per request. Once exceeded, the tool returns an error.

      • modestring可选

        Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored.

        取值 instantfastautodeep-litedeepdeep-reasoningturbobasicadvanced
      • search_promptstring可选

        Prompt that introduces the search results to the model.

      • user_locationobject可选

        Approximate user location for location-biased search results.

      • allowed_domainsarray可选

        Only fetch from these domains.

      • blocked_domainsarray可选

        Never fetch from these domains.

      • max_content_tokensinteger可选

        Maximum content length in approximate tokens. Content exceeding this limit is truncated.

      • pdfobject可选

        Options for PDF parsing.

      • max_pricenumber可选

        Maximum input price in USD per million tokens. When set, quality-tier selection (min_coding_score) is bypassed: the router computes the Pareto frontier over the top coding models and routes to the best-scoring frontier model priced at or below this cap, falling back through cheaper frontier models, then non-frontier models. Enforced against the price source given by price_source. Returns 404 when no candidate satisfies the cap.

      • min_coding_scorenumber可选

        Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). Not used when max_price is set (price-based selection takes over).

      • price_sourcestring可选

        Price source for the Pareto frontier cost axis and for enforcing max_price. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".

        取值 promptweighted_avg
      • analysis_modelsarray可选

        For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-sol-latest, ~google/gemini-pro-latest).

      • max_tool_callsinteger可选

        For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 4. Capped at 16.

      • modelstring可选

        For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the slug of the model that performs both the analyst step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset.

      • presetstring可选

        Configuration for a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. A curated OpenRouter preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.

        取值 general-highgeneral-budgetgeneral-fast
      • toolsarray可选

        For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).

    • predictionobject可选

      Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.

      ▸ 展开子字段(2)
      • contentstring | array必填

        Predicted output: a string or an array of text parts.

      • typestring必填

        Always `content`. Discriminator that marks this object as a Prediction in a `type`-tagged union.

        取值 content
    • presence_penaltynumber可选◐ Partially supported

      Presence penalty (-2.0 to 2.0)

      An effect was observed on deepseek-v4-flash via /openai; some qwen3.8-flash requests return 400 and other effects are unobservable.

    • prompt_cache_keystring可选
    • prompt_cache_optionsobject可选

      Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.

      ▸ 展开子字段(2)
      • modestring必填

        Prompt cache mode; explicit caches only the blocks marked with prompt_cache_breakpoint.

        取值 explicit
      • ttlstring可选

        Lifetime of cache entries, for example 30m; null leaves the provider default.

    • providerobject可选◐ Partially supported

      When multiple model providers are available, optionally indicate your routing preference.

      Only supplier choice (order / only / ignore) is BYOK-only and returns 400; require_parameters is honoured and other options are accepted no-ops.

      ▸ 展开子字段(13)
      • allow_fallbacksboolean可选○ Currently ignored

        Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

      • data_collectionstring可选○ Currently ignored

        Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it - deny: use only providers which do not collect user data.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

        取值 denyallownull
      • enforce_distillable_textboolean可选

        Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.

      • ignorearray可选○ Unsupported

        List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.

        Choosing suppliers (order / only / ignore) is BYOK-only; with platform credentials it returns 400 PROVIDER_SELECTION_NOT_ALLOWED.

      • max_priceobject可选○ Currently ignored

        The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

      • onlyarray可选○ Unsupported

        List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.

        Choosing suppliers (order / only / ignore) is BYOK-only; with platform credentials it returns 400 PROVIDER_SELECTION_NOT_ALLOWED.

      • orderarray可选○ Unsupported

        An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.

        Choosing suppliers (order / only / ignore) is BYOK-only; with platform credentials it returns 400 PROVIDER_SELECTION_NOT_ALLOWED.

      • preferred_max_latencynumber | object可选

        Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.

      • preferred_min_throughputnumber | object可选

        Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.

      • quantizationsarray可选○ Currently ignored

        A list of quantization levels to filter the provider by.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

      • require_parametersboolean可选

        Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.

        Routes only to lines that can express every parameter; available with platform credentials.

      • sortstring | object可选○ Currently ignored

        The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

      • zdrboolean可选○ Currently ignored

        Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.

        Accepted but currently has no effect (not supplier choice; available with platform credentials).

    • reasoningobject可选

      Configuration options for reasoning models

      ▸ 展开子字段(2)
      • effortstring可选◐ Partially supported

        Constrains effort on reasoning for reasoning models

        none reliably disables thinking only on qwen3.8-flash; deepseek-v4-flash and glm-5.3-flash do not honor it.

        取值 maxxhighhighmediumlowminimalnonenull
      • summarystring可选○ Currently ignored

        How detailed the reasoning summary should be.

        Accepted but currently has no effect. deepseek-v4-flash did not return the requested summary.

        取值 autoconcisedetailednull
    • reasoning_effortstring可选◐ Partially supported

      Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ.

      none disables thinking on qwen3.8-flash; deepseek-v4-flash still thinks and glm-5.3-flash effort levels do not behave as expected.

      取值 maxxhighhighmediumlowminimalnonenull
    • repetition_penaltynumber可选

      Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter.

    • routestring可选

      **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").

      取值 fallbacksortnull
    • seedinteger可选○ Currently ignored

      Random seed for deterministic outputs

      Accepted but currently has no effect. The same seed did not reproduce outputs on deepseek-v4-flash, glm-5.3-flash or qwen3.8-flash.

    • service_tierstring可选

      The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.

      取值 autodefaultfastflexpriorityscalenull
    • session_idstring可选

      A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.

    • stop_server_tools_whenarray可选

      Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.

      ▸ 展开子字段(6)

      元素按 type 区分(finish_reason_is / has_tool_call / max_cost / max_tokens_used / step_count_is),此处展开其中一种的形状

      • step_countinteger可选

        Number of steps after which the loop stops.

      • typestring可选

        Always `finish_reason_is`. Discriminator that marks this object as a StopServerToolsWhenFinishReasonIs in a `type`-tagged union.

        取值 finish_reason_is
      • tool_namestring可选

        Name of the tool whose call stops the loop.

      • max_tokensinteger可选

        Cumulative token count after which the loop stops.

      • max_cost_in_dollarsnumber可选

        Cumulative cost in USD after which the loop stops.

      • reasonstring可选

        Finish reason that stops the loop.

    • stream_optionsobject可选

      Streaming configuration options

      ▸ 展开子字段(1)
      • include_usageboolean可选○ Currently ignored

        Deprecated: This field has no effect. Full usage details are always included.

        Accepted but currently has no effect. Usage is returned at the end whether true, false or omitted.

    • top_anumber可选○ Currently ignored

      Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter.

      Accepted but currently has no effect.

    • top_kinteger可选◐ Partially supported

      Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter.

      No sampling effect was observed on tested models; deepseek-v4-flash via /model returns an error.

    • top_logprobsinteger可选◐ Partially supported

      Number of top log probabilities to return (0-20)

      Requires logprobs=true; support follows logprobs and the selected model.

    • traceobject可选

      Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.

      ▸ 展开子字段(5)
      • generation_namestring可选

        Name of this generation in the trace.

      • parent_span_idstring可选

        Id of the parent span in the trace.

      • span_namestring可选

        Name of this request's span in the trace.

      • trace_idstring可选

        Id that groups several requests into one trace.

      • trace_namestring可选

        Name of the trace.

    • userstring可选

      Per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account.

    • storeboolean可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • max_output_tokensinteger可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • thinkingobject可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • web_search_optionsobject可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • functionsarray可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • audioobject可选○ Currently ignored

      Accepted but currently has no effect. This applies to Chat Completions only.

    • ninteger可选◐ Partially supported

      Works on glm-5.3-flash; accepted but ignored on deepseek-v4-flash; qwen3.8-flash errors.

    • usageobject可选○ Currently ignored

      Accepted and ignored; usage is always returned, regardless of include.

    • transformsarray可选○ Currently ignored

      Accepted and ignored; no middle-out or other message transformation is performed.

    • deferred_toolsobject可选○ Currently ignored

      Accepted and ignored; the OpenRouter deferred-tool protocol is not implemented.

    • promptstring可选○ Currently ignored

      Accepted and ignored; Chat still requires messages and this field does not replace them.

    • structured_outputsboolean可选○ Currently ignored

      Accepted and ignored; configure structured output with response_format, subject to its documented support.

    • include_reasoningboolean可选○ Currently ignored

      Accepted and ignored legacy alias; use reasoning subject to its documented support.

    • safe_promptboolean可选○ Currently ignored

      Accepted and ignored; the Mistral safe_prompt switch is not implemented.

    • raw_modeboolean可选○ Currently ignored

      Accepted and ignored; the Hyperbolic raw_mode switch is not implemented.

Returns

200 chat.completion

With stream=true the reply streams as server-sent events (text/event-stream).

Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Successful chat completion response

application/json

NameTypeDescription
choicesarray<object>List of completion choices
choices[].finish_reasonstring | null
choices[].indexintegerChoice index
choices[].logprobsobject | nullLog probabilities for the completion
choices[].messageobjectAssistant message for requests and responses
createdintegerUnix timestamp of creation
idstringUnique completion identifier
modelstringModel used for completion
objectstring
openrouter_metadataobjectRouting report: what was requested, how the router chose, and what was attempted.
openrouter_metadata.attemptintegerNumber of the attempt that served the request, starting at 1.
openrouter_metadata.attemptsarray<object>Every attempt that was made, in order.
openrouter_metadata.endpointsobjectWhich endpoints were available and which one was chosen.
openrouter_metadata.generation_timeintegerMilliseconds measured for the generation, from dispatching the upstream request until its response body ended. Divide the completion token count by this for throughput. Absent when no upstream request was dispatched.
openrouter_metadata.is_byokbooleanWhether the request used a key supplied by the caller.
openrouter_metadata.paramsobjectRouter parameters that applied to the request.
openrouter_metadata.pipelinearray<object>Stages the request went through before and after the model call.
openrouter_metadata.regionstring | nullRegion that served the request; null when unknown.
openrouter_metadata.requestedstringThe model or alias the request asked for.
openrouter_metadata.strategystringHow the router picked the model or provider for this request.
openrouter_metadata.summarystringOne-line summary of the routing decision.
service_tierstring | nullThe service tier used by the upstream provider for this request
system_fingerprintstring | nullSystem fingerprint
usageobjectToken usage statistics
usage.completion_tokensintegerNumber of tokens in the completion
usage.completion_tokens_detailsobject | nullDetailed completion token usage
usage.costnumber | nullCost of the completion
usage.cost_detailsobject | nullBreakdown of upstream inference costs
usage.is_byokbooleanWhether a request was made using a Bring Your Own Key configuration
usage.prompt_tokensintegerNumber of tokens in the prompt
usage.prompt_tokens_detailsobject | nullDetailed prompt token usage
usage.server_tool_use_detailsobject | nullUsage for server-side tool execution (e.g., web search)
usage.total_tokensintegerTotal number of tokens

text/event-stream — chunk / event object

NameTypeDescription
dataobjectStreaming chat completion chunk
data.choicesarray<object>List of streaming chunk choices
data.createdintegerUnix timestamp of creation
data.errorobjectError information
data.idstringUnique chunk identifier
data.modelstringModel used for completion
data.objectstring
data.openrouter_metadataobjectRouting report: what was requested, how the router chose, and what was attempted.
data.service_tierstring | nullThe service tier used by the upstream provider for this request
data.system_fingerprintstringSystem fingerprint
data.usageobjectToken usage statistics

Create a response

POST /openai/v1/responses● Supported

Official OpenAI docs ↗

Request body

  • modelstring必填◐ Partially supported

    Verified on glm-5.3-flash and deepseek-flash; models without Responses support return 404.

  • streamboolean可选◐ Partially supported
    默认 false

    Works on deepseek-flash; glm-5.3-flash returns 400.

  • temperaturenumber可选◐ Partially supported

    Partly effective on glm-5.3-flash; 2 may produce empty or garbled text. Effects on deepseek-flash are unobservable.

  • top_pnumber可选◐ Partially supported

    Sampling changes were observed on glm-5.3-flash; effects on deepseek-flash are unobservable.

  • toolsarray可选◐ Partially supported

    function works. web_search, code_interpreter, image_generation, mcp and computer_use are accepted but currently have no effect; file_search returns 404.

  • tool_choicestring | object可选◐ Partially supported

    How the model picks tools: a mode string or a specific tool.

    auto works. required/named functions on deepseek-flash require reasoning.effort=none. allowed_tools is ignored by glm-5.3-flash and returns 422 on deepseek-flash.

    ▸ 展开子字段(4)
    • namestring必填

      Name of the function or tool the model must call.

    • typestring必填

      Kind of tool the model must call.

      取值 shell
    • modestring必填

      auto lets the model pick among the allowed tools or none; required forces a call to one of them.

    • toolsarray必填

      The allowed tools, each as a tool reference such as {type: function, name}.

  • backgroundboolean可选◐ Partially supported

    Whether to run the model response in the background. Available only when the routed model has Router-built background support — Router returns status "queued" immediately, then stream-calls the upstream itself, runs the job to a terminal state, and bills usage exactly once, while the client polls GET /v1/responses/{id} (this does not mean the upstream natively supports OpenAI's background parameter). A provider without this capability still returns HTTP 400 (native_responses_background_unsupported) for background:true. Cancel (POST /v1/responses/{id}/cancel) can only stop our own read of the upstream stream — it cannot guarantee upstream compute already issued stops — and billing reflects only usage actually received, falling back to the platform's general "upstream reported no usage" rule when none was received.

    Works on deepseek-flash; glm-5.3-flash returns 400. Combining background with stream returns JSON.

  • includearray可选◐ Partially supported

    Forwarded to the upstream model as-is; only takes effect for capabilities the model has (e.g., reasoning content, web search results). Fields the model doesn't support are ignored.

    deepseek-flash returns logprobs, but reasoning.encrypted_content is only a placeholder. glm-5.3-flash accepts but currently ignores include.

  • inputstring | array可选◐ Partially supported

    Input for a response request - can be a string or array of items

    Strings, message arrays, input_text, input_image and function round trips work. input_file errors on glm-5.3-flash and is ignored by deepseek-flash; managed file references return 400.

  • instructionsstring可选

    Verified to take effect.

  • ▸ 更多参数(21)
    • max_output_tokensinteger可选

      A positive value controls the output budget; zero returns 400.

    • metadataobject可选◐ Partially supported

      Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.

      Echoed on glm-5.3-flash; accepted but currently ignored by deepseek-flash, with empty metadata in both creation and retrieval.

    • parallel_tool_callsboolean可选◐ Partially supported

      true permits multiple calls; false is accepted but currently has no effect and may still return multiple calls.

    • previous_response_idany可选

      ID of a previous response. Its owner may continue it; the model field can then be omitted. The platform expands the stored history before calling the upstream.

      The platform combines ancestor inputs and outputs with the current input. We remove previous_response_id before calling the upstream. A missing live copy or a response owned by another tenant returns 404 previous_response_not_found.

    • promptobject可选○ Unsupported

      Reference to a saved prompt template and its variables. We don't have a Prompts resource yet — any id you pass returns 404 object_not_found.

      No saved prompt templates are available; passing a template id returns 404.

      ▸ 展开子字段(2)
      • idstring必填

        Id of the stored prompt template.

      • variablesobject可选

        Values for the template variables, keyed by variable name; a value is a string or an input text, image or file part.

    • prompt_cache_keystring可选
    • prompt_cache_optionsobject可选

      Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.

      ▸ 展开子字段(2)
      • modestring必填

        Prompt cache mode; explicit caches only the blocks marked with prompt_cache_breakpoint.

        取值 explicit
      • ttlstring可选

        Lifetime of cache entries, for example 30m; null leaves the provider default.

    • reasoningobject可选

      Configuration for reasoning mode in the response

      ▸ 展开子字段(6)
      • contextstring可选

        Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.

        取值 autoall_turnscurrent_turnnull
      • effortstring可选◐ Partially supported

        How much reasoning the model should spend.

        none disables thinking on deepseek-flash; other levels are not monotonic. glm-5.3-flash accepts but ignores it, including none.

        取值 maxxhighhighmediumlowminimalnonenull
      • modestring可选

        Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.

        取值 standardpronull
      • summarystring可选◐ Partially supported

        How detailed the reasoning summary should be.

        concise occasionally yields a summary on glm-5.3-flash, while auto/detailed did not. deepseek-flash accepts but ignores it.

        取值 autoconcisedetailednull
      • enabledboolean可选
      • max_tokensinteger可选
    • safety_identifierstring可选

      Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, we fold it into the hashed identity sent upstream and never forward it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account.

    • service_tierstring可选
      默认 "auto"

      Requested service tier; its effect is currently unobservable.

      取值 autodefaultfastflexpriorityscalenull
    • storeboolean可选
      默认 true

      Whether to store the response server-side so it can be retrieved or continued later via previous_response_id. Defaults to true; pass false to opt out.

      true stores the response for retrieval; false does not, and retrieval returns 404.

    • textobject可选

      Text output configuration including format and verbosity

      ▸ 展开子字段(2)
      • formatobject可选◐ Partially supported

        Text response format configuration

        json_object and json_schema work with sufficient budget; text intermittently returns 400 on glm-5.3-flash and works on deepseek-flash.

      • verbositystring可选○ Currently ignored

        Accepted but currently has no effect. No verbosity effect was observed on glm-5.3-flash or deepseek-flash.

        取值 lowmediumhighxhighmaxnull
    • top_logprobsinteger可选◐ Partially supported

      Works on deepseek-flash with values 0–20; glm-5.3-flash returns empty logprobs.

    • truncationstring可选

      How to handle input that exceeds the context window.

      取值 autodisablednull
    • userstring可选

      A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters.

    • conversationstring可选

      The conversation this response belongs to (a conversation id string, or a `{id}` object). Before the request reaches the upstream provider, we prepend that conversation's existing items to this request's input; after the response completes, this turn's input and output items are appended back to the conversation. Only the conversation's owner may reference it — otherwise 404 object_not_found; cannot be used together with previous_response_id — sending both returns 400.

      Conversation history is included in input and response items are appended; cannot be combined with previous_response_id.

    • context_managementarray可选

      Context management configuration for this request (e.g. automatic compaction once a token threshold is exceeded).

    • moderationobject可选

      Configuration for running moderation on the input and output of this response.

    • prompt_cache_retentionstring可选

      The retention policy for the prompt cache. Set to 24h to keep cached prefixes active for up to 24 hours.

    • stream_optionsobject可选

      Options for streaming responses. Only set this when stream=true (e.g. whether to include usage statistics at the end of the stream).

    • access_programsobject可选○ Unsupported

      Recognized official field; access programs are not implemented and return 400 explicitly stating that the parameter is not supported.

Returns

200 response

With stream=true the reply streams as server-sent events (text/event-stream).

Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
backgroundboolean | nullWhether the response was started in background mode.
completed_atinteger | nullUnix time in seconds at which the response finished; null while it has not finished.
created_atintegerUnix time in seconds at which the response was created.
errorobject | nullError information returned from the API
error.codestringMachine-readable error code.
error.messagestringHuman-readable error message.
frequency_penaltynumber | nullThe frequency penalty that applied to the request, if any.
idstringUnique id of the response; use it as response_id to retrieve, cancel or delete it, or as previous_response_id to continue the conversation.
incomplete_detailsobject | nullWhy the response stopped before finishing; null for complete responses.
incomplete_details.reasonstringWhy the response is incomplete.
instructionsstring | array<object> | nullInput of the request: a string or an array of input items.
max_output_tokensinteger | nullUpper bound on generated tokens that applied to the request; null when none was set.
max_tool_callsinteger | nullUpper bound on built-in tool calls that applied to the request; null when none was set.
metadataobject | nullMetadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
modelstringModel that produced the response.
objectstringObject type; always `response`.
outputarray<object>Items the model produced, in order: messages, reasoning, tool calls and tool results.
output[].contentarray<object> | array | null | stringContent parts of the message: output text or refusal. / Reasoning text parts, when the provider returns them. / Text content of the fetched page.
output[].idstringId of the message item. / Id of the reasoning item. / Id of the function call item. / Id of the web search call item. / Id of the file search call item. / Id of the image generation call item. / Id of the code interpreter call item. / Id of the computer call item. / Id of the datetime server tool item. / Id of the web search server tool item. / Id of the code interpreter server tool item. / Id of the file search server tool item. / Id of the image generation server tool item. / Id of the browser use server tool item. / Id of the bash server tool item. / Id of the text editor server tool item. / Id of the apply_patch server tool item. / Id of the apply_patch call item. / Id of the shell call item. / Id of the shell call output item. / Id of the shell server tool item. / Id of the web fetch server tool item. / Id of the tool search server tool item. / Id of the memory server tool item. / Id of the MCP server tool item. / Id of the model search server tool item. / Id of the fusion server tool item. / Id of the advisor server tool item. / Id of the subagent server tool item. / Id of the files server tool item. / Id of the custom tool call item.
output[].phasestring | nullThe phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
output[].rolestringRole of the author; always assistant.
output[].statusstringStatus of the message item. / Status of the reasoning item. / Status of the function call item. / Status of a web search call. / Status of a web search call. / Status of an image generation call. / Status of the code interpreter call. / Status of the computer call item. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call that can fail. / Status of a tool call. / Status of a tool call. / Lifecycle state of an `apply_patch_call` output item. / Status of a shell call or its output. / Status of a shell call or its output. / Status of a tool call that can fail. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call. / Status of a tool call that can fail. / Status of a tool call that can fail. / Status of a tool call. / Status of the custom tool call item.
output[].typestringAlways `message`. Discriminator that marks this object as a OutputMessage in a `type`-tagged union. / Always `reasoning`. Discriminator that marks this object as a OutputItemReasoning in a `type`-tagged union. / Always `function_call`. Discriminator that marks this object as a OutputItemFunctionCall in a `type`-tagged union. / Always `web_search_call`. Discriminator that marks this object as a OutputItemWebSearchCall in a `type`-tagged union. / Always `file_search_call`. Discriminator that marks this object as a OutputItemFileSearchCall in a `type`-tagged union. / Always `image_generation_call`. Discriminator that marks this object as a OutputItemImageGenerationCall in a `type`-tagged union. / Always `code_interpreter_call`. Discriminator that marks this object as a OutputItemCodeInterpreterCall in a `type`-tagged union. / Always `computer_call`. Discriminator that marks this object as a OutputComputerCallItem in a `type`-tagged union. / Always `openrouter:datetime`. Discriminator that marks this object as a OutputDatetimeItem in a `type`-tagged union. / Always `openrouter:web_search`. Discriminator that marks this object as a OutputWebSearchServerToolItem in a `type`-tagged union. / Always `openrouter:code_interpreter`. Discriminator that marks this object as a OutputCodeInterpreterServerToolItem in a `type`-tagged union. / Always `openrouter:file_search`. Discriminator that marks this object as a OutputFileSearchServerToolItem in a `type`-tagged union. / Always `openrouter:image_generation`. Discriminator that marks this object as a OutputImageGenerationServerToolItem in a `type`-tagged union. / Always `openrouter:browser_use`. Discriminator that marks this object as a OutputBrowserUseServerToolItem in a `type`-tagged union. / Always `openrouter:bash`. Discriminator that marks this object as a OutputBashServerToolItem in a `type`-tagged union. / Always `openrouter:text_editor`. Discriminator that marks this object as a OutputTextEditorServerToolItem in a `type`-tagged union. / Always `openrouter:apply_patch`. Discriminator that marks this object as a OutputApplyPatchServerToolItem in a `type`-tagged union. / Always `apply_patch_call`. Discriminator that marks this object as a OutputApplyPatchCallItem in a `type`-tagged union. / Always `shell_call`. Discriminator that marks this object as a OutputShellCallItem in a `type`-tagged union. / Always `shell_call_output`. Discriminator that marks this object as a OutputShellCallOutputItem in a `type`-tagged union. / Always `openrouter:shell`. Discriminator that marks this object as a OutputShellServerToolItem in a `type`-tagged union. / Always `openrouter:web_fetch`. Discriminator that marks this object as a OutputWebFetchServerToolItem in a `type`-tagged union. / Always `openrouter:tool_search`. Discriminator that marks this object as a OutputToolSearchServerToolItem in a `type`-tagged union. / Always `openrouter:memory`. Discriminator that marks this object as a OutputMemoryServerToolItem in a `type`-tagged union. / Always `openrouter:mcp`. Discriminator that marks this object as a OutputMcpServerToolItem in a `type`-tagged union. / Always `openrouter:experimental__search_models`. Discriminator that marks this object as a OutputSearchModelsServerToolItem in a `type`-tagged union. / Always `openrouter:fusion`. Discriminator that marks this object as a OutputFusionServerToolItem in a `type`-tagged union. / Always `openrouter:advisor`. Discriminator that marks this object as a OutputAdvisorServerToolItem in a `type`-tagged union. / Always `openrouter:subagent`. Discriminator that marks this object as a OutputSubagentServerToolItem in a `type`-tagged union. / Always `openrouter:files`. Discriminator that marks this object as a OutputFilesServerToolItem in a `type`-tagged union. / Always `custom_tool_call`. Discriminator that marks this object as a OutputCustomToolCallItem in a `type`-tagged union.
output[].encrypted_contentstring | nullOpaque encrypted reasoning; send it back unchanged to let the model continue its reasoning on the next turn.
output[].summaryarray<object>Summary parts of the reasoning.
output[].formatstring | nullWire format of the reasoning details, which names the provider family that produced them.
output[].signaturestring | nullA signature for the reasoning content, used for verification
output[].argumentsstring | string | null | string | null | string | null | string | string | nullJSON-encoded arguments the model produced for the function. / The raw tool-call arguments string as emitted by the model. / The raw tool-call arguments string as emitted by the model. Echo back unchanged when replaying history; used verbatim to preserve provider prompt-cache prefixes. / The raw tool-call arguments string as emitted by the model. / The JSON arguments submitted to the search tool (e.g. {"query":"Claude"}) / The raw tool-call arguments string as emitted by the model.
output[].asyncbooleanTrue when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
output[].call_idstring | string | null | string | string | string | string | string | null | string | string | null | stringId of the call; the function_call_output item that answers it repeats it as call_id. / Id of the call; the computer_call_output item that answers it repeats it as call_id. / The model-generated tool call id from the originating turn. / Id of the apply_patch tool call. / Id of the call; the apply_patch_call_output item that answers it repeats it as call_id. / Id of the call; the shell_call_output item that answers it repeats it as call_id. / Id of the shell call this output answers. / The model-generated tool call id from the originating turn. / EXPERIMENTAL — subject to change without notice. The `call_id` of the tool call that spawned this subagent. This id will also be included as the `subagent_id` on any `function_call` items created by the subagent. This must be returned in the request so the `function_call` can be matched with the correct subagent. A suspended `in_progress` item is announced once and never re-emitted or terminally closed — completion arrives as a new item with the same `call_id`. / The model-generated tool call id from the originating turn. / Id of the call; the custom_tool_call_output item that answers it repeats it as call_id.
output[].namestringName of the function being called. / Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent. / Name of the custom tool being called.
output[].namespacestringNamespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
output[].subagent_idstringEXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
output[].subagent_itemsarray<object>EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
output[].actionobject | any | object | string | object | object | stringThe search action the model took: a search, opening a page, or finding a pattern in a page. / The action the model asks the client to perform on the computer. / The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. / The browser action that was performed. / The commands the model asks the client to run. / The commands that were run. / Memory action that was performed.
output[].queriesarray<string>Queries the model ran against the vector stores. / Queries that ran against the vector stores.
output[].resultstring | null | stringBase64-encoded generated image; null while generation has not finished. / The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format / JSON-serialized result of the file operation.
output[].promptstringThe prompt (possibly rewritten) that the image was generated from. / The prompt the executor sent to the advisor.
output[].codestring | null | stringThe code the interpreter ran; null while it is still being written. / The code that ran.
output[].container_idstringId of the container the code ran in. / The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. / The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. / The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
output[].outputsarray | nullOutputs of the run: logs and images; null while the run has not finished.
output[].pending_safety_checksarray<object>Safety checks that must be acknowledged before the action is performed.
output[].datetimestringISO 8601 datetime string
output[].timezonestringIANA timezone name
output[].exitCodeintegerExit code of the run; 0 means success. / Exit code of the command; 0 means success.
output[].languagestringLanguage of the code that ran.
output[].stderrstringStandard error output of the code. / Standard error output of the command.
output[].stdoutstringStandard output of the code. / Standard output of the command.
output[].imageB64stringBase64-encoded generated image.
output[].imageUrlstringURL of the generated image.
output[].revisedPromptstringPrompt after the image model rewrote it.
output[].screenshotB64stringBase64-encoded screenshot taken after the action.
output[].commandstringThe bash command that ran. / Editor command that ran.
output[].errorstringThe error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'failed'`; absent on a successful call. A non-zero `exitCode` is a command failure, not a tool failure. / The error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'incomplete'` and an empty `output`; absent on a successful call. / The error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'failed'`; absent on a successful call. `output` is omitted when `error` is set. / The error message if the fetch failed. / Error message when the fusion run did not produce an analysis result. / Error message when the advisor call did not produce advice. Set together with `status: 'failed'` on the terminal item. / Error message when the subagent task did not produce an outcome. Set together with `status: 'failed'` on the terminal item. / Error message when the file operation failed.
output[].filesarray<object>Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
output[].filePathstringPath of the file the command worked on.
output[].operationobject | stringThe patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. / The file operation performed (list, read, write, or edit).
output[].max_output_lengthinteger | nullMaximum number of characters of output that was kept; null for no limit.
output[].outputarray<object>Output of each command, in the order the commands ran.
output[].httpStatusintegerThe HTTP status code returned by the upstream URL fetch.
output[].titlestringTitle of the fetched page.
output[].urlstringURL that was fetched.
output[].querystringThe tool search query. / The model search query.
output[].keystringKey of the memory entry.
output[].valueanyValue of the memory entry; absent for reads that found nothing and for deletes.
output[].serverLabelstringLabel of the MCP server.
output[].toolNamestringName of the MCP tool that was called.
output[].analysisobjectStructured analysis produced by the fusion analyst model.
output[].failed_modelsarray<object>Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel.
output[].failure_reasonstringTyped failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, invalid_model, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. The four analysis-stage codes keep their pre-rename `judge_` spelling so existing consumers keep matching. The consumer-cancellation code is `cancelled`.
output[].responsesarray<object>Analysis models that produced a response in this fusion run, with each model's full panel content.
output[].sourcesarray<object>Web pages the analysis panels and analyst retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.
output[].advicestringThe advisor model's response (the advice text returned to the executor).
output[].instance_namestringProvider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance. / Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation.
output[].modelstringSlug of the advisor model that was consulted. / Slug of the worker model that executed the task.
output[].outcomestringThe worker model's result (the outcome text returned to the delegating model).
output[].task_descriptionstringThe task description the delegating model sent to the worker.
output[].task_namestringThe short task identifier the delegating model supplied.
output[].file_idstringThe target file id supplied in the tool-call arguments.
output[].filenamestringThe target filename supplied in the tool-call arguments.
output[].inputstringFree-form input the model produced for the custom tool.
output_textstringConvenience concatenation of all output text of the response.
parallel_tool_callsbooleanWhether the model was allowed to call several tools in one turn.
presence_penaltynumber | nullThe presence penalty that applied to the request, if any.
previous_response_idstring | nullId of the response this one continued; null when it started a new conversation.
promptobject | nullReference to a stored prompt template with its variables.
prompt.idstringId of the stored prompt template.
prompt.variablesobject | nullValues for the template variables, keyed by variable name; a value is a string or an input text, image or file part.
prompt_cache_keystring | nullCache key the request supplied to improve prompt cache hits; null when none was set.
prompt_cache_optionsobject | nullRequest-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
prompt_cache_options.modestringPrompt cache mode; explicit caches only the blocks marked with prompt_cache_breakpoint.
prompt_cache_options.ttlstring | nullLifetime of cache entries, for example 30m; null leaves the provider default.
reasoningobject | nullReasoning settings that applied: effort, summary verbosity, mode and context.
reasoning.contextstring | nullControls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
reasoning.effortstring | nullHow much reasoning the model should spend.
reasoning.modestring | nullSelects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
reasoning.summarystring | nullHow detailed the reasoning summary should be.
safety_identifierstring | nullEnd-user identifier the request supplied for abuse monitoring; null when none was set.
service_tierstring | nullService tier the provider used for the response; null when not reported.
statusstringLifecycle status of the response.
storebooleanWhether the response is stored so it can be retrieved later.
temperaturenumber | nullSampling temperature that applied to the request, if any.
textobjectText output configuration including format and verbosity
text.formatobjectText response format configuration
text.verbositystring | nullHow long the answer should be.
tool_choicestring | objectHow the model picks tools: a mode string or a specific tool.
tool_choice.namestringName of the function or tool the model must call.
tool_choice.typestringKind of tool the model must call. / Always `allowed_tools`. Discriminator that marks this object as a ToolChoiceAllowed in a `type`-tagged union. / Kind of tool the model must call. / Kind of tool the model must call.
tool_choice.modestringauto lets the model pick among the allowed tools or none; required forces a call to one of them.
tool_choice.toolsarray<object>The allowed tools, each as a tool reference such as {type: function, name}.
toolsarray<object>Tools that were available to the model for this response.
tools[].descriptionstring | null | string | stringWhat the function does and when to use it; the model reads this to decide whether to call it. / What the custom tool does and when to use it. / What the group of tools is for.
tools[].namestringName of the function; the model uses it in function_call items. / Name of the custom tool. / Name of the namespace that groups the tools.
tools[].parametersobject | nullJSON Schema of the function arguments; null when the function takes none.
tools[].strictboolean | nullWhether to enforce strict argument validation against the schema; null leaves the provider default.
tools[].typestringAlways `function`. Discriminator that marks this object as a FunctionTool in a `type`-tagged union. / Always `web_search_preview`. Discriminator that marks this object as a Preview_WebSearchServerTool in a `type`-tagged union. / Always `web_search_preview_2025_03_11`. Discriminator that marks this object as a Preview_20250311_WebSearchServerTool in a `type`-tagged union. / Always `web_search`. Discriminator that marks this object as a Legacy_WebSearchServerTool in a `type`-tagged union. / Always `web_search_2025_08_26`. Discriminator that marks this object as a WebSearchServerTool in a `type`-tagged union. / Comparison operator. / Always `computer_use_preview`. Discriminator that marks this object as a ComputerUseServerTool in a `type`-tagged union. / Always `code_interpreter`. Discriminator that marks this object as a CodeInterpreterServerTool in a `type`-tagged union. / Always `mcp`. Discriminator that marks this object as a McpServerTool in a `type`-tagged union. / Always `image_generation`. Discriminator that marks this object as a ImageGenerationServerTool in a `type`-tagged union. / Always `local_shell`. Discriminator that marks this object as a CodexLocalShellTool in a `type`-tagged union. / Always `shell`. Discriminator that marks this object as a ShellServerTool in a `type`-tagged union. / Always `apply_patch`. Discriminator that marks this object as a ApplyPatchServerTool in a `type`-tagged union. / Always `custom`. Discriminator that marks this object as a CustomTool in a `type`-tagged union. / Always `namespace`. Discriminator that marks this object as a NamespaceTool in a `type`-tagged union.
tools[].asyncbooleanLets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
tools[].defer_loadingbooleanWithhold this tool from the model until `openrouter:tool_search` finds it. Requires the tool search server tool; at least one tool must remain non-deferred.
tools[].enginestringWhich search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results).
tools[].filtersobject | nullRestricts web search by domain. / Attribute filter applied to the search: a comparison or a compound filter.
tools[].max_resultsintegerMaximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.
tools[].max_usesintegerMaximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
tools[].modestringEngine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored.
tools[].search_context_sizestringSize of the search context for web search tools
tools[].user_locationobject | nullApproximate location of the user, used to bias web search results. / User location information for web search / User location information for web search
tools[].max_num_resultsintegerMaximum number of results to return, between 1 and 50.
tools[].ranking_optionsobjectRanking options for the search.
tools[].vector_store_idsarray<string>Ids of the vector stores to search.
tools[].display_heightintegerHeight of the computer display in pixels.
tools[].display_widthintegerWidth of the computer display in pixels.
tools[].environmentstringKind of environment that is controlled.
tools[].containerstring | objectContainer for the code to run in: a container id or an automatic container with files.
tools[].allowed_toolsarray<string> | object | nullTools of the server the model may use: a list of names or a filter.
tools[].authorizationstringOAuth access token for the MCP server.
tools[].connector_idstringId of a built-in connector; give this or server_url.
tools[].headersobject | nullHTTP headers sent to the MCP server; null for none.
tools[].require_approvalobject | string | nullWhether tool calls need approval before they run: always, never, or a filter per tool.
tools[].server_descriptionstringWhat the MCP server is for, which helps the model decide when to use it.
tools[].server_labelstringLabel that names the MCP server in the conversation.
tools[].server_urlstringURL of the MCP server; give this or connector_id.
tools[].backgroundstringBackground of the generated image.
tools[].input_fidelitystring | nullHow closely to preserve details of input images; null uses the default.
tools[].input_image_maskobjectMask that marks the region of the input image to edit.
tools[].modelstringImage model to use.
tools[].moderationstringModeration level applied to the generated image.
tools[].output_compressionintegerCompression level from 0 to 100 for jpeg and webp output.
tools[].output_formatstringFile format of the generated image.
tools[].partial_imagesintegerNumber of partial images to stream while generating, from 0 to 3.
tools[].qualitystringQuality of the generated image.
tools[].sizestringSize of the generated image; auto lets the model choose.
tools[].formatobjectFormat of the tool input: free text or a grammar.
tools[].toolsarray<object>Function tools in the namespace.
top_logprobsintegerNumber of most likely tokens whose log probabilities were requested per position.
top_pnumber | nullNucleus sampling value that applied to the request, if any.
truncationstring | nullHow to handle input that exceeds the context window.
usageobject | nullToken usage information for the response
usage.input_tokensintegerNumber of input tokens, cached tokens included.
usage.input_tokens_detailsobjectBreakdown of the input tokens.
usage.output_tokensintegerNumber of output tokens, reasoning tokens included.
usage.output_tokens_detailsobjectBreakdown of the output tokens.
usage.total_tokensintegerInput plus output tokens.
usage.costnumber | nullCost of the completion
usage.cost_detailsobjectBreakdown of the upstream inference cost.
usage.is_byokbooleanWhether a request was made using a Bring Your Own Key configuration
usage.server_tool_use_detailsobject | nullUsage for server-side tool execution (e.g., web search)
userstring | nullEnd-user identifier the request supplied; null when none was set.
error_typestringCanonical OpenRouter error type, stable across all API formats
openrouter_metadataobjectRouting report: what was requested, how the router chose, and what was attempted.
openrouter_metadata.attemptintegerNumber of the attempt that served the request, starting at 1.
openrouter_metadata.attemptsarray<object>Every attempt that was made, in order.
openrouter_metadata.endpointsobjectWhich endpoints were available and which one was chosen.
openrouter_metadata.generation_timeintegerMilliseconds measured for the generation, from dispatching the upstream request until its response body ended. Divide the completion token count by this for throughput. Absent when no upstream request was dispatched.
openrouter_metadata.is_byokbooleanWhether the request used a key supplied by the caller.
openrouter_metadata.paramsobjectRouter parameters that applied to the request.
openrouter_metadata.pipelinearray<object>Stages the request went through before and after the model call.
openrouter_metadata.regionstring | nullRegion that served the request; null when unknown.
openrouter_metadata.requestedstringThe model or alias the request asked for.
openrouter_metadata.strategystringHow the router picked the model or provider for this request.
openrouter_metadata.summarystringOne-line summary of the routing decision.

text/event-stream — chunk / event object

NameTypeDescription
dataobjectUnion of all possible event types emitted during response streaming
data.responseobjectComplete non-streaming response from the Responses API
data.sequence_numberintegerPosition of this event in the stream. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream; it increases with every event, so use it to order events or detect a gap. / Position of this event in the stream.
data.typestringAlways `response.created`. Discriminator that marks this object as a CreatedEvent in a `type`-tagged union. / Always `response.in_progress`. Discriminator that marks this object as a InProgressEvent in a `type`-tagged union. / Always `response.completed`. Discriminator that marks this object as a CompletedEvent in a `type`-tagged union. / Always `response.incomplete`. Discriminator that marks this object as a IncompleteEvent in a `type`-tagged union. / Always `response.failed`. Discriminator that marks this object as a FailedEvent in a `type`-tagged union. / Always `error`. Discriminator that marks this object as a BaseErrorEvent in a `type`-tagged union. / Always `response.output_item.added`. Discriminator that marks this object as a OutputItemAddedEvent in a `type`-tagged union. / Always `response.output_item.done`. Discriminator that marks this object as a OutputItemDoneEvent in a `type`-tagged union. / Always `response.content_part.added`. Discriminator that marks this object as a BaseContentPartAddedEvent in a `type`-tagged union. / Always `response.content_part.done`. Discriminator that marks this object as a BaseContentPartDoneEvent in a `type`-tagged union. / Always `response.output_text.delta`. Discriminator that marks this object as a BaseTextDeltaEvent in a `type`-tagged union. / Always `response.output_text.done`. Discriminator that marks this object as a BaseTextDoneEvent in a `type`-tagged union. / Always `response.refusal.delta`. Discriminator that marks this object as a BaseRefusalDeltaEvent in a `type`-tagged union. / Always `response.refusal.done`. Discriminator that marks this object as a BaseRefusalDoneEvent in a `type`-tagged union. / Always `response.output_text.annotation.added`. Discriminator that marks this object as a BaseAnnotationAddedEvent in a `type`-tagged union. / Always `response.function_call_arguments.delta`. Discriminator that marks this object as a BaseFunctionCallArgsDeltaEvent in a `type`-tagged union. / Always `response.function_call_arguments.done`. Discriminator that marks this object as a BaseFunctionCallArgsDoneEvent in a `type`-tagged union. / Always `response.reasoning_text.delta`. Discriminator that marks this object as a BaseReasoningDeltaEvent in a `type`-tagged union. / Always `response.reasoning_text.done`. Discriminator that marks this object as a BaseReasoningDoneEvent in a `type`-tagged union. / Always `response.reasoning_summary_part.added`. Discriminator that marks this object as a BaseReasoningSummaryPartAddedEvent in a `type`-tagged union. / Always `response.reasoning_summary_part.done`. Discriminator that marks this object as a BaseReasoningSummaryPartDoneEvent in a `type`-tagged union. / Always `response.reasoning_summary_text.delta`. Discriminator that marks this object as a BaseReasoningSummaryTextDeltaEvent in a `type`-tagged union. / Always `response.reasoning_summary_text.done`. Discriminator that marks this object as a BaseReasoningSummaryTextDoneEvent in a `type`-tagged union. / Always `response.image_generation_call.in_progress`. Discriminator that marks this object as a OpenAIResponsesImageGenCallInProgress in a `type`-tagged union. / Always `response.image_generation_call.generating`. Discriminator that marks this object as a OpenAIResponsesImageGenCallGenerating in a `type`-tagged union. / Always `response.image_generation_call.partial_image`. Discriminator that marks this object as a OpenAIResponsesImageGenCallPartialImage in a `type`-tagged union. / Always `response.image_generation_call.completed`. Discriminator that marks this object as a OpenAIResponsesImageGenCallCompleted in a `type`-tagged union. / Always `response.code_interpreter_call.in_progress`. Discriminator that marks this object as a OpenAIResponsesCodeInterpreterCallInProgress in a `type`-tagged union. / Always `response.code_interpreter_call.interpreting`. Discriminator that marks this object as a OpenAIResponsesCodeInterpreterCallInterpreting in a `type`-tagged union. / Always `response.code_interpreter_call.completed`. Discriminator that marks this object as a OpenAIResponsesCodeInterpreterCallCompleted in a `type`-tagged union. / Always `response.code_interpreter_call_code.delta`. Discriminator that marks this object as a OpenAIResponsesCodeInterpreterCallCodeDelta in a `type`-tagged union. / Always `response.code_interpreter_call_code.done`. Discriminator that marks this object as a OpenAIResponsesCodeInterpreterCallCodeDone in a `type`-tagged union. / Always `response.web_search_call.in_progress`. Discriminator that marks this object as a OpenAIResponsesWebSearchCallInProgress in a `type`-tagged union. / Always `response.web_search_call.searching`. Discriminator that marks this object as a OpenAIResponsesWebSearchCallSearching in a `type`-tagged union. / Always `response.web_search_call.completed`. Discriminator that marks this object as a OpenAIResponsesSearchCompleted in a `type`-tagged union. / Always `response.custom_tool_call_input.delta`. Discriminator that marks this object as a BaseCustomToolCallInputDeltaEvent in a `type`-tagged union. / Always `response.custom_tool_call_input.done`. Discriminator that marks this object as a BaseCustomToolCallInputDoneEvent in a `type`-tagged union. / Always `response.apply_patch_call_operation_diff.delta`. Discriminator that marks this object as a ApplyPatchCallOperationDiffDeltaEvent in a `type`-tagged union. / Always `response.apply_patch_call_operation_diff.done`. Discriminator that marks this object as a ApplyPatchCallOperationDiffDoneEvent in a `type`-tagged union. / Always `response.fusion_call.in_progress`. Discriminator that marks this object as a FusionCallInProgressEvent in a `type`-tagged union. / Always `response.fusion_call.panel.added`. Discriminator that marks this object as a FusionCallPanelAddedEvent in a `type`-tagged union. / Always `response.fusion_call.panel.delta`. Discriminator that marks this object as a FusionCallPanelDeltaEvent in a `type`-tagged union. / Always `response.fusion_call.panel.reasoning.delta`. Discriminator that marks this object as a FusionCallPanelReasoningDeltaEvent in a `type`-tagged union. / Always `response.fusion_call.panel.completed`. Discriminator that marks this object as a FusionCallPanelCompletedEvent in a `type`-tagged union. / Always `response.fusion_call.panel.failed`. Discriminator that marks this object as a FusionCallPanelFailedEvent in a `type`-tagged union. / Always `response.fusion_call.analysis.in_progress`. Discriminator that marks this object as a FusionCallAnalysisInProgressEvent in a `type`-tagged union. / Always `response.fusion_call.analysis.completed`. Discriminator that marks this object as a FusionCallAnalysisCompletedEvent in a `type`-tagged union. / Always `response.fusion_call.completed`. Discriminator that marks this object as a FusionCallCompletedEvent in a `type`-tagged union. / Always `response.debug`. Discriminator that marks this object as a DebugEvent in a `type`-tagged union.
data.codestring | null | stringError code; null when the upstream gave none. / The complete code the interpreter runs.
data.messagestringHuman-readable error message.
data.paramstring | nullName of the request parameter the error is about; null when it is not about a parameter.
data.itemobjectAn output item from the response
data.output_indexintegerIndex of the item in the response output array that this event belongs to.
data.content_indexintegerIndex of the content part inside the output item that this event belongs to.
data.item_idstringId of the output item this event belongs to; it equals the id of that item in the response output.
data.partobjectThe content part as it starts: output text or refusal. / The content part in its final form: output text or refusal. / A reasoning summary part. / A reasoning summary part.
data.deltastringText fragment to append to the output text of this content part. / Refusal text fragment to append. / Fragment of the JSON-encoded function arguments to append. / Reasoning text fragment to append. / Reasoning summary text fragment to append. / Fragment of the code the interpreter will run, to append. / Fragment of the custom tool call input to append. / Fragment of the patch diff to append. / Text fragment the panel model produced. / Reasoning text fragment the panel model produced.
data.logprobsarray<object>Log probabilities of the tokens in this fragment, when requested. / Log probabilities of the tokens in the complete text, when requested.
data.textstringThe complete output text of this content part. / The complete reasoning text of this content part. / The complete reasoning summary text of this part.
data.refusalstringThe complete refusal text.
data.annotationobjectAnnotation attached to output text: a file citation, URL citation or file path.
data.annotation_indexintegerIndex of the new annotation inside the content part's annotations array.
data.argumentsstringThe complete JSON-encoded arguments of the function call.
data.namestringName of the function being called.
data.summary_indexintegerIndex of the reasoning summary part inside the reasoning item that this event belongs to.
data.partial_image_b64stringBase64-encoded partial image produced while generation is still running.
data.partial_image_indexintegerZero-based index of this partial image among the partial images of the call.
data.inputstringThe complete input of the custom tool call.
data.diffstringThe complete patch diff.
data.modelstringSlug of the panel model that started. / Slug of the panel model that produced the fragment. / Slug of the panel model that produced the fragment. / Slug of the panel model that finished. / Slug of the panel model that failed.
data.contentstringThe complete answer of the panel model.
data.errorstringError message that explains why the panel model failed.
data.status_codeintegerHTTP status code of the failed upstream call, when one is available.
data.analyst_modelstringSlug of the model producing the structured analysis.
data.judge_modelstringDeprecated alias of `analyst_model`, kept so existing consumers keep working. Always carries the same value. Use `analyst_model`.
data.analysisobjectStructured analysis produced by the fusion analyst model.
data.debugobjectDebug information.

Retrieve a response

Call Create response first, then replace resp_123 with the returned ID.

GET /openai/v1/responses/{response_id}● Supported

Official OpenAI docs ↗

Request parameters

  • response_idstring必填

    path:

Returns

200 response

Reads a stored response by ID. If it was created with store set to false we did not store it, and the read returns 404 response_not_found; after the retention period (30 days by default) the read returns the same 404.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API response

application/json

NameTypeDescription
$object

Delete a response

Call Create response first, then replace resp_123 with the returned ID.

DELETE /openai/v1/responses/{response_id}● Supported

Official OpenAI docs ↗

Request parameters

  • response_idstring必填

    path:

Returns

200 response

Deletes a stored response by ID immediately. If it was created with store set to false we did not store it, and the delete returns 404 response_not_found.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API delete response

application/json

NameTypeDescription
$object

Call Create response first, then replace resp_123 with the returned ID.

POST /openai/v1/responses/{response_id}/cancel◐ Partial

Official OpenAI docs ↗

Request parameters

  • response_idstring必填

    path:

Returns

200 response

Available only for responses created with background:true and routed to a model that can generate in the background. Cancel is idempotent — repeated calls return the same terminal response. Cancelling stops us reading the upstream stream; it cannot guarantee that compute already sent upstream stops, and usage is billed for what was actually received. Calling cancel on a non-background (synchronous) response returns 404 object_not_found if the response id does not exist (not stored, expired or wrong id), or 400 native_responses_operation_unsupported if the response exists but its provider does not declare cancel support (none of the upstreams we connect declares it for synchronous responses). Neither case is the not-implemented 501.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API cancel response

application/json

NameTypeDescription
$object

List input items

Call Create response first, then replace resp_123 with the returned ID.

GET /openai/v1/responses/{response_id}/input_items● Supported

Official OpenAI docs ↗

Request parameters

  • response_idstring必填

    path:

Returns

200 list

Lists the input items of a stored response. Supports limit (1–100, default 20), order (asc/desc, default desc, as in the official API) and cursor pagination by item id with after; has_more / first_id / last_id match the page actually returned, so you can page through without gaps or repeats. Every item carries a server-issued id (msg_ for messages, and each of function_call / function_call_output / reasoning has its own prefix); older data stored before ids existed gets deterministic ids on read, without a destructive migration, so repeated reads with the same cursor stay stable. For a response created with previous_response_id, the list shows the full resolved input: the input and output items of the earlier responses in the chain plus the input submitted this turn; if an ancestor response was not stored on the platform (for example created with store false) or has expired, only this turn's own input is listed. If the response was created with store set to false we did not store it, and the list returns 404 response_not_found.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API input item list

application/json

NameTypeDescription
$object

POST /openai/v1/responses/compact○ Unsupported

Official OpenAI docs ↗

Returns

501 This endpoint is not implemented yet; calling it returns the response below:

Compacts a response's input into a summary. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API compact response

application/json

NameTypeDescription
$object

POST /openai/v1/responses/input_tokens○ Unsupported

Official OpenAI docs ↗

Returns

501 This endpoint is not implemented yet; calling it returns the response below:

Counts the tokens the request input would consume without generating content. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API input token count

application/json

NameTypeDescription
$object

Create a conversation

POST /openai/v1/conversations● Supported

Official OpenAI docs ↗

Request body

  • itemsarray可选

    Verified to take effect.

  • metadataobject可选

    Verified to take effect.

Returns

200 conversation

Creates a conversation, optionally with initial items (up to 20 at a time) and metadata. Conversations are partitioned by tenant; only the creating tenant can reference it.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The created conversation

application/json

NameTypeDescription
idstringId of the conversation, such as `conv_...`; use it as `conversation_id` in conversation calls and as `conversation` in createResponse.
objectstringObject type; always `conversation`.
created_atintegerUnix time in seconds at which the conversation was created.
metadataobjectUp to 16 string key/value pairs; keys at most 64 characters and values at most 512.

Retrieve a conversation

Call Create conversation first, then replace conv_123 with the returned conv_ ID.

GET /openai/v1/conversations/{conversation_id}● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

Returns

200 conversation

Reads a conversation by ID. A conversation that does not exist or belongs to another tenant returns 404 conversation_not_found.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The conversation

application/json

NameTypeDescription
idstringId of the conversation, such as `conv_...`; use it as `conversation_id` in conversation calls and as `conversation` in createResponse.
objectstringObject type; always `conversation`.
created_atintegerUnix time in seconds at which the conversation was created.
metadataobjectUp to 16 string key/value pairs; keys at most 64 characters and values at most 512.

Update a conversation

Call Create conversation first, then replace conv_123 with the returned conv_ ID.

POST /openai/v1/conversations/{conversation_id}● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

  • metadataobject必填

    Verified to take effect.

Returns

200 conversation

Updates a conversation's metadata — the whole object is replaced, not merged with the existing metadata.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The updated conversation

application/json

NameTypeDescription
idstringId of the conversation, such as `conv_...`; use it as `conversation_id` in conversation calls and as `conversation` in createResponse.
objectstringObject type; always `conversation`.
created_atintegerUnix time in seconds at which the conversation was created.
metadataobjectUp to 16 string key/value pairs; keys at most 64 characters and values at most 512.

Delete a conversation

Call Create conversation first, then replace conv_123 with the returned conv_ ID.

DELETE /openai/v1/conversations/{conversation_id}● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

Returns

200 conversation.deleted

Deletes a conversation. After deletion neither the conversation nor its items can be referenced again (including as the conversation parameter of Responses create).

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Deletion confirmation

application/json

NameTypeDescription
idstring
objectstring
deletedboolean

Create conversation items

Call Create conversation first, then replace conv_123 with the returned conv_ ID.

POST /openai/v1/conversations/{conversation_id}/items● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

  • itemsarray必填

    Verified to take effect.

Returns

200 list

Appends items to a conversation (up to 20 at a time) and returns the items just added.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The items just added

application/json

NameTypeDescription
objectstringObject type; always `list`.
dataarray<object>Items of the conversation, in the order the list requested.
first_idstringId of the first item of this page; null for an empty page.
last_idstringId of the last item of this page; null for an empty page.
has_morebooleanWhether more items exist beyond this page; pass `last_id` as `after` to read them.

List conversation items

Call Create conversation first, then replace conv_123 with the returned conv_ ID.

GET /openai/v1/conversations/{conversation_id}/items● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

  • limitinteger可选
    默认 20

    query: Maximum items per page (values above 100 are clamped).

  • afterstring可选

    query: Item ID from the previous page; returns items after this cursor.

  • orderstring可选
    默认 "desc"

    query: Sort by stored creation order.

    取值 ascdesc

Returns

200 list

Lists a conversation's items in creation order, with limit / after / order pagination.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The conversation's items

application/json

NameTypeDescription
objectstringObject type; always `list`.
dataarray<object>Items of the conversation, in the order the list requested.
first_idstringId of the first item of this page; null for an empty page.
last_idstringId of the last item of this page; null for an empty page.
has_morebooleanWhether more items exist beyond this page; pass `last_id` as `after` to read them.

Retrieve a conversation item

Call Create conversation first, then replace conv_123 with the returned conv_ ID. Replace item_123 with an item ID from Create conversation items or List conversation items.

GET /openai/v1/conversations/{conversation_id}/items/{item_id}● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

  • item_idstring必填

    path:

Returns

200

Reads a single item of a conversation by ID.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The item

application/json

NameTypeDescription
$object

Delete a conversation item

Call Create conversation first, then replace conv_123 with the returned conv_ ID. Replace item_123 with an item ID from Create conversation items or List conversation items.

DELETE /openai/v1/conversations/{conversation_id}/items/{item_id}● Supported

Official OpenAI docs ↗

Request parameters

  • conversation_idstring必填

    path:

  • item_idstring必填

    path:

Returns

200 conversation

Deletes a single item of a conversation and returns the conversation object (not the deleted item).

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The conversation, with the item removed

application/json

NameTypeDescription
idstringId of the conversation, such as `conv_...`; use it as `conversation_id` in conversation calls and as `conversation` in createResponse.
objectstringObject type; always `conversation`.
created_atintegerUnix time in seconds at which the conversation was created.
metadataobjectUp to 16 string key/value pairs; keys at most 64 characters and values at most 512.

Create an image

POST /openai/v1/images/generations● Supported

Official OpenAI docs ↗

Request body

  • modelstring必填

    Verified to take effect.

  • response_formatstring可选○ Unsupported

    Omit for GPT Image models, which return native base64 data. Only send for models that explicitly support response_format; platform hosting is a separate Image extension.

    gpt-image-2 returns 400 for both b64_json and url; omit this field.

    取值 urlb64_json
  • promptstring必填

    Verified to take effect.

  • ninteger可选
    默认 1

    Controls image count; zero returns 400 and values 1–10 are accepted.

  • sizestring可选◐ Partially supported

    gpt-image-2 supports tested 1024x1024 and 1024x1536 sizes; 512x512 returns 400.

    取值 1024x10241024x15361536x1024auto
  • qualitystring可选

    Verified to take effect.

    取值 lowmediumhighauto
  • backgroundstring可选

    transparent returns a transparent PNG on gpt-image-2.

  • output_formatstring可选

    jpeg returns JPEG on gpt-image-2.

Returns

200

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Image generation response

application/json

NameTypeDescription
createdinteger
dataarray<object>
data[].urlstring
data[].b64_jsonstring
data[].revised_promptstring

List models

GET /openai/v1/models● Supported

Official OpenAI docs ↗

Request parameters

  • offsetinteger可选
    默认 0

    query: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned

    Verified to take effect.

  • limitinteger可选

    query: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned

    Verified to take effect.

  • categorystring可选○ Currently ignored

    query: Filter models by use case category

    Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    取值 programmingroleplaymarketingmarketing/seotechnologysciencetranslationlegalfinancehealthtriviaacademia
  • supported_parametersstring可选○ Currently ignored

    query: Filter models by supported parameter (comma-separated)

    Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

  • output_modalitiesstring可选

    query: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. When omitted, all models are included; comma-separated modalities match any output.

    Verified to take effect.

  • sortstring可选

    query: Sort by newest creation date or lowest declared USD unit rate (not estimated request cost). Unpriced models sort last; ties retain catalog order.

    Verified to take effect.

    取值 newestprice_low
  • qstring可选

    query: Free-text search by model name or slug.

    Verified to take effect.

  • input_modalitiesstring可选○ Currently ignored

    query: Filter models by input modality. Comma-separated list of: text, image, audio, file.

    Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

  • contextinteger可选○ Currently ignored

    query: Minimum context length (tokens). Models with smaller context are excluded.

    Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

  • min_pricenumber可选○ Currently ignored

    query: Minimum prompt price in $/M tokens.

    Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

  • ▸ 更多参数(20)
    • max_pricenumber可选○ Currently ignored

      query: Maximum prompt price in $/M tokens.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • archstring可选○ Currently ignored

      query: Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama).

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • model_authorsstring可选○ Currently ignored

      query: Filter models by the organization that created the model. Comma-separated list of author slugs.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • providersstring可选○ Currently ignored

      query: Filter models by hosting provider. Comma-separated list of provider names.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • distillablestring可选○ Currently ignored

      query: Filter by distillation capability. "true" returns only distillable models, "false" excludes them.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

      取值 truefalse
    • zdrstring可选○ Currently ignored

      query: When set to "true", return only models with zero data retention endpoints.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

      取值 true
    • regionstring可选○ Currently ignored

      query: Filter to models with endpoints in the given data region ("eu" or "us").

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

      取值 euus
    • min_output_pricenumber可选○ Currently ignored

      query: Minimum completion (output) price in $/M tokens.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_output_pricenumber可选○ Currently ignored

      query: Maximum completion (output) price in $/M tokens.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • min_age_daysinteger可选○ Currently ignored

      query: Minimum model age in days since its creation date.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_age_daysinteger可选○ Currently ignored

      query: Maximum model age in days since its creation date.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • min_intelligence_indexnumber可选○ Currently ignored

      query: Minimum Artificial Analysis intelligence index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_intelligence_indexnumber可选○ Currently ignored

      query: Maximum Artificial Analysis intelligence index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • min_coding_indexnumber可选○ Currently ignored

      query: Minimum Artificial Analysis coding index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_coding_indexnumber可选○ Currently ignored

      query: Maximum Artificial Analysis coding index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • min_agentic_indexnumber可选○ Currently ignored

      query: Minimum Artificial Analysis agentic index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_agentic_indexnumber可选○ Currently ignored

      query: Maximum Artificial Analysis agentic index.

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • min_tool_success_ratenumber可选○ Currently ignored

      query: Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason).

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • max_tool_success_ratenumber可选○ Currently ignored

      query: Maximum tool-calling success rate, as a fraction in [0, 1].

      Accepted but currently has no effect. Currently does not filter or sort the models by this criterion.

    • apiarray可选

      query: Match any comma-separated API family: chat selects openai.chat.completions; responses selects openai.responses; embeddings selects openai.embeddings; images selects openai.images.*; audio selects openai.audio.*; videos selects openai.videos. Omitted or empty includes all OpenAI-offered models. Other filters combine using AND, before pagination. Invalid values return 400 with all legal values.

      Filters declared OpenAI APIs before pagination; comma-separated families match any selected API.

Returns

200 list

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Returns a list of models or RSS feed

application/json

NameTypeDescription
dataarray<object>List of available models
data[].alias_targetobjectConcrete model targeted by this tilde-latest alias, when applicable
data[].architectureobjectModel architecture information
data[].benchmarksobjectThird-party benchmark rankings for this model. Omitted when no benchmark data is available.
data[].canonical_slugstringCanonical slug for the model
data[].context_lengthinteger | nullMaximum context length in tokens
data[].createdintegerUnix timestamp of when the model was created
data[].default_parametersobject | nullDefault parameters for this model
data[].descriptionstringDescription of the model
data[].expiration_datestring | nullThe date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.
data[].hugging_face_idstring | nullHugging Face model identifier, if applicable
data[].idstringUnique identifier for the model
data[].knowledge_cutoffstring | nullThe date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.
data[].linksobjectRelated API endpoints and resources for this model.
data[].namestringDisplay name of the model
data[].per_request_limitsobject | nullPer-request token limits
data[].pricingobjectPricing information for the model
data[].reasoningobjectReasoning effort configuration. Omitted for non-reasoning models and dynamic router models.
data[].supported_parametersarray<string>List of supported parameters for this model
data[].supported_voicesarray | nullList of supported voice identifiers for TTS models. Null for non-TTS models.
data[].top_providerobjectInformation about the top provider for this model
linksobjectPagination links
links.nextstring | nullURL for the next page of results, or null if this is the last page
total_countintegerTotal number of models matching the query

Retrieve model

GET /openai/v1/models/{model}● Supported

Official OpenAI docs ↗

Request parameters

  • modelstring必填

    path: Model ID from GET /openai/v1/models, including any publisher prefix.

Returns

200 model

Returns the same model object as its entry in the list. Only models that declare an OpenAI API are visible; model IDs may carry slash-separated publisher prefixes. A model that does not exist or declares no OpenAI API returns 404.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

The matching OpenRouter model list entry.

application/json

NameTypeDescription
alias_targetobjectConcrete model targeted by this tilde-latest alias, when applicable
alias_target.namestringHuman-readable name of the concrete model targeted by this alias
alias_target.slugstringRoutable model ID of the concrete target, matching that model row's id
architectureobjectModel architecture information
architecture.input_modalitiesarray<string>Supported input modalities
architecture.instruct_typestring | nullInstruction format type
architecture.modalitystring | nullPrimary modality of the model
architecture.output_modalitiesarray<string>Supported output modalities
architecture.tokenizerstringTokenizer type used by the model
benchmarksobjectThird-party benchmark rankings for this model. Omitted when no benchmark data is available.
benchmarks.artificial_analysisobjectArtificial Analysis benchmark index scores.
benchmarks.design_arenaarray<object>Design Arena ELO rankings across arena+category pairs.
canonical_slugstringCanonical slug for the model
context_lengthinteger | nullMaximum context length in tokens
createdintegerUnix timestamp of when the model was created
default_parametersobject | nullDefault parameters for this model
default_parameters.frequency_penaltynumber | null
default_parameters.presence_penaltynumber | null
default_parameters.repetition_penaltynumber | null
default_parameters.temperaturenumber | null
default_parameters.top_kinteger | null
default_parameters.top_pnumber | null
descriptionstringDescription of the model
expiration_datestring | nullThe date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.
hugging_face_idstring | nullHugging Face model identifier, if applicable
idstringUnique identifier for the model
knowledge_cutoffstring | nullThe date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.
linksobjectRelated API endpoints and resources for this model.
links.detailsstringURL for the model details/endpoints API
namestringDisplay name of the model
per_request_limitsobject | nullPer-request token limits
per_request_limits.completion_tokensnumberMaximum completion tokens per request
per_request_limits.prompt_tokensnumberMaximum prompt tokens per request
pricingobjectPricing information for the model
pricing.audiostringPrice in USD per audio input token
pricing.audio_outputstringPrice in USD per audio output token
pricing.completionstringPrice in USD per token for completion (output) generation
pricing.discountnumberFractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)
pricing.imagestringPrice in USD per image; present only for a flat registry price
pricing.image_outputstringPrice in USD per output image
pricing.image_tokenstringPrice in USD per image token
pricing.input_audio_cachestringPrice in USD per cached audio input token
pricing.input_cache_readstringPrice in USD per cached input token (read)
pricing.input_cache_writestringPrice per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.
pricing.input_cache_write_1hstringPrice per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.
pricing.internal_reasoningstringPrice in USD per internal reasoning token
pricing.overridesarray<object>Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.
pricing.promptstringPrice in USD per token for prompt (input) processing
pricing.requeststringPrice in USD per request
pricing.web_searchstringPrice in USD per web search
pricing.video_secondstringPraxis extension: USD per second of output video.
pricing.audio_input_minutestringPraxis extension: USD per minute of input audio.
pricing.audio_output_minutestringPraxis extension: USD per minute of output audio.
pricing.input_characterstringPraxis extension: USD per input character.
pricing.pagestringPraxis extension: USD per OCR page.
reasoningobjectReasoning effort configuration. Omitted for non-reasoning models and dynamic router models.
reasoning.default_effortstring | nullDefault reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning.
reasoning.default_enabledbooleanDefault reasoning enabled state when the client does not set `reasoning.enabled`.
reasoning.mandatorybooleanWhen true, reasoning cannot be disabled and effort "none" is rejected.
reasoning.supported_effortsarray | nullAllowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted.
reasoning.supports_max_tokensbooleanPresent and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise.
supported_parametersarray<string>List of supported parameters for this model
supported_voicesarray | nullList of supported voice identifiers for TTS models. Null for non-TTS models.
top_providerobjectInformation about the top provider for this model
top_provider.context_lengthinteger | nullContext length from the top provider
top_provider.is_moderatedbooleanWhether the top provider moderates content
top_provider.max_completion_tokensinteger | nullMaximum completion tokens from the top provider. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens.

Create embeddings

POST /openai/v1/embeddings● Supported

Official OpenAI docs ↗

Request body

  • modelstring必填

    The model to use for embeddings

    Verified to take effect.

  • dimensionsinteger可选◐ Partially supported

    The number of dimensions for the output embeddings

    Only text-embedding-3-small and qwen3-vl-embedding support the tested 256 dimensions; text-embedding-3-small also supports 512, while 100 returns 400. 256 returns 400 on bge-m3, qwen3-embedding-0.6b and doubao-embedding-vision.

  • encoding_formatstring可选

    The format of the output embeddings

    Both float and base64 are supported; base64 encodes the vector bytes.

    取值 floatbase64
  • inputstring | array必填◐ Partially supported

    Text, token, or multimodal input(s) to embed

    Text and text arrays work; integer token arrays return 400. Images work only on qwen3-vl-embedding and doubao-embedding-vision; a 16-item text-embedding-3-small batch returns 400.

  • input_typestring可选◐ Partially supported

    The type of input (e.g. search_query, search_document)

    query/document work on bge-m3 and qwen3-embedding-0.6b; search_query returns 400. text-embedding-3-small accepts but currently ignores this field.

  • providerobject可选◐ Partially supported

    Provider routing preferences for the request.

    bge-m3 and qwen3-embedding-0.6b return 400; text-embedding-3-small accepts it, with an unobservable effect.

    ▸ 展开子字段(13)
    • allow_fallbacksboolean可选

      Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable.

    • data_collectionstring可选

      Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it - deny: use only providers which do not collect user data.

      取值 denyallownull
    • enforce_distillable_textboolean可选

      Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.

    • ignorearray可选

      List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.

    • max_priceobject可选

      The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.

    • onlyarray可选

      List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.

    • orderarray可选

      An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.

    • preferred_max_latencynumber | object可选

      Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.

    • preferred_min_throughputnumber | object可选

      Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.

    • quantizationsarray可选

      A list of quantization levels to filter the provider by.

    • require_parametersboolean可选

      Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.

    • sortstring | object可选

      The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.

    • zdrboolean可选

      Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.

  • session_idstring可选◐ Partially supported

    A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.

    bge-m3 and qwen3-embedding-0.6b return 400; text-embedding-3-small accepts it, with an unobservable effect.

  • traceobject可选◐ Partially supported

    Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.

    bge-m3 and qwen3-embedding-0.6b return 400; text-embedding-3-small accepts it, with an unobservable effect.

    ▸ 展开子字段(5)
    • generation_namestring可选

      Name of this generation in the trace.

    • parent_span_idstring可选

      Id of the parent span in the trace.

    • span_namestring可选

      Name of this request's span in the trace.

    • trace_idstring可选

      Id that groups several requests into one trace.

    • trace_namestring可选

      Name of the trace.

  • userstring可选◐ Partially supported

    A unique identifier for the end-user

    bge-m3 and qwen3-embedding-0.6b return 400; text-embedding-3-small accepts it, with an unobservable effect.

Returns

200 list

Forwarded the same way as chat completions, and usage is billed on the same account. Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Embedding response

application/json

NameTypeDescription
dataarray<object>List of embedding objects
data[].embeddingarray<number> | stringEmbedding vector as an array of floats or a base64 string
data[].indexintegerIndex of the embedding in the input list
data[].objectstring
idstringUnique identifier for the embeddings response
modelstringThe model used for embeddings
objectstring
usageobjectToken usage statistics
usage.costnumberCost of the request in credits
usage.cost_detailsobject | nullBreakdown of upstream inference costs
usage.is_byokbooleanWhether a request was made using a Bring Your Own Key configuration
usage.prompt_tokensintegerNumber of tokens in the input
usage.prompt_tokens_detailsobjectPer-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.
usage.total_tokensintegerTotal number of tokens used

text/event-stream — chunk / event object

NameTypeDescription
$stringNot used for embeddings - embeddings do not support streaming

Create video

POST /openai/v1/videos● Supported

Official OpenAI docs ↗

Request body

  • modelstring可选◐ Partially supported

    Video model id, for example `wan2.7-t2v`; list candidates with listModels?type=video. Router support (partial): Select a registered video model explicitly, for example wan2.7-t2v (size=1280x720, seconds=4). Capability preflight errors are reported before creation.

    Select a registered video model explicitly, for example wan2.7-t2v (size=1280x720, seconds=4). Capability preflight errors are reported before creation.

  • promptstring必填

    Text description of the video, at least 1 character. Router support (supported): Controls video content; missing or empty values return 400.

    Controls video content; missing or empty values return 400.

  • secondsstring | integer可选

    When both are supplied, seconds overrides duration.

    Duration works on wan2.7-t2v; malformed values or values outside model capabilities return 400 during preflight.

  • durationinteger可选

    Length of the video in whole seconds. `seconds` takes precedence when both are given.

  • sizestring可选◐ Partially supported

    Output resolution as `WIDTHxHEIGHT`, for example `1280x720`. Router support (partial): Subject to model capability preflight. Earlier wan2.7-t2v samples always produced 1280x720; accepted sizes are not guaranteed pixel-for-pixel.

    Subject to model capability preflight. Earlier wan2.7-t2v samples always produced 1280x720; accepted sizes are not guaranteed pixel-for-pixel.

  • input_referencestring | object可选

    Reference image for image-to-video: a URL or base64 data URL, an object with `image_url`, or an uploaded image file (multipart, at most 20 MiB).

    ▸ 展开子字段(1)
    • image_urlstring | object必填

      URL or base64 data URL of the reference image, as a string or an object with `url`.

  • input_referencesarray可选

    Several reference images; each entry is a URL or base64 data URL, or an object with `image_url`.

    ▸ 展开子字段(1)
    • image_urlstring | object可选

      URL or base64 data URL of the reference image, as a string or an object with `url`.

  • frame_imagesarray可选

    Images that pin the first and last frame; at most 2 entries.

    ▸ 展开子字段(3)
    • typeany可选

      Always `image_url`. Discriminator of the `type`-tagged union this object belongs to.

    • frame_typeany必填

      Frame to constrain with the supplied image: first_frame or last_frame. Each frame type may occur at most once.

      取值 first_framelast_frame
    • image_urlobject必填

      The image to pin.

  • resolutionstring可选

    Output resolution label such as `720p`, for models that take a label instead of `size`.

  • aspect_ratiostring可选

    Aspect ratio of the video such as `16:9`.

  • ▸ 更多参数(4)
    • generate_audioboolean可选

      Whether the video carries a generated audio track. Router support (supported): false produces no audio track on wan2.7-t2v; the default output includes audio.

      false produces no audio track on wan2.7-t2v; the default output includes audio.

    • seedinteger可选

      Seed for reproducible generation, on models that support it.

    • callback_urlstring可选

      HTTP or HTTPS callback URL, forwarded to models that support completion callbacks.

    • qualitystring可选

      Provider-specific quality setting.

Returns

200 video

Generates video asynchronously: create a job, poll its status, then download the content. Billed per second of output; GET /model/v1/models exposes pricing.video_second in USD per second. Select a registered video model explicitly, for example wan2.7-t2v.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Success

application/json

NameTypeDescription
idstringId of the video job; pass it as `video_id` to retrieve, download or delete it.
objectstringObject type; always `video`.
modelstringModel that generates the video.
statusstringLifecycle of the job. Poll until it is `completed` or `failed`.
progressintegerProgress from 0 to 100. It is 0 until the job completes and 100 once it has.
created_atintegerUnix time in seconds at which the job was created.
completed_atinteger | nullUnix time in seconds at which the job completed; null until then.
expires_atinteger | nullUnix time in seconds after which the output expires; null because outputs currently have no expiry.
secondsstringLength of the video in seconds, as a string; for a completed job it is the delivered length.
sizestringResolution of the video as `WIDTHxHEIGHT`; null when the provider did not report one.
promptstring | nullPrompt the job was created with.
remixed_from_video_idnullAlways null; remix is not supported.
errorobject | nullWhy the job failed; null unless status is `failed`.
error.codestringMachine-readable failure code.
error.messagestringHuman-readable failure message.
polling_urlstringRelative URL to poll for the job state; same as retrieveVideo for this job.
unsigned_urlsarray<string>Relative URLs of the finished output; empty until the video is ready. Download them with the same API key.
usageobjectCost of the job; present once a price applies.
usage.costnumberCost of the job in USD: delivered seconds times the per-second price once completed, 0 while running.

List videos

GET /openai/v1/videos● Supported

Official OpenAI docs ↗

Request parameters

  • afterstring可选

    query: Cursor: the id of the video job after which the page starts, normally the `last_id` of the previous page. It must refer to an existing job of yours, otherwise the call fails.

    Pagination works; limit is 1–100, order is asc/desc, and after must refer to an existing job.

  • limitinteger可选
    默认 20

    query: Maximum number of jobs per page, from 1 to 100; defaults to 20.

    Pagination works; limit is 1–100, order is asc/desc, and after must refer to an existing job.

  • orderany可选
    默认 "desc"

    query: Sort order by creation time: desc (default) lists the newest job first, asc the oldest first.

    Pagination works; limit is 1–100, order is asc/desc, and after must refer to an existing job.

    取值 ascdesc

Returns

200 list

Lists the video jobs of your account. limit is 1–100, order is asc or desc, and after must refer to an existing job.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Success

application/json

NameTypeDescription
objectstringObject type; always `list`.
dataarray<object>Video jobs of the caller, newest first by default.
data[].idstringId of the video job; pass it as `video_id` to retrieve, download or delete it.
data[].objectstringObject type; always `video`.
data[].modelstringModel that generates the video.
data[].statusstringLifecycle of the job. Poll until it is `completed` or `failed`.
data[].progressintegerProgress from 0 to 100. It is 0 until the job completes and 100 once it has.
data[].created_atintegerUnix time in seconds at which the job was created.
data[].completed_atinteger | nullUnix time in seconds at which the job completed; null until then.
data[].expires_atinteger | nullUnix time in seconds after which the output expires; null because outputs currently have no expiry.
data[].secondsstringLength of the video in seconds, as a string; for a completed job it is the delivered length.
data[].sizestringResolution of the video as `WIDTHxHEIGHT`; null when the provider did not report one.
data[].promptstring | nullPrompt the job was created with.
data[].remixed_from_video_idnullAlways null; remix is not supported.
data[].errorobject | nullWhy the job failed; null unless status is `failed`.
data[].polling_urlstringRelative URL to poll for the job state; same as retrieveVideo for this job.
data[].unsigned_urlsarray<string>Relative URLs of the finished output; empty until the video is ready. Download them with the same API key.
data[].usageobjectCost of the job; present once a price applies.
has_morebooleanWhether more jobs exist beyond this page; pass `last_id` as `after` to read them.
first_idstring | nullId of the first job in this page; null for an empty page.
last_idstring | nullId of the last job in this page; null for an empty page.

Retrieve video

Call Create video first and replace video_123 with its ID; poll until completed before downloading.

GET /openai/v1/videos/{video_id}● Supported

Official OpenAI docs ↗

Request parameters

  • video_idstring必填

    path: Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400.

Returns

200 video

Reads the job's current status and progress. Keep polling while status is queued or in_progress, inspect error when it is failed, and download the content only once it is completed. An unknown job returns 404.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Success

application/json

NameTypeDescription
idstringId of the video job; pass it as `video_id` to retrieve, download or delete it.
objectstringObject type; always `video`.
modelstringModel that generates the video.
statusstringLifecycle of the job. Poll until it is `completed` or `failed`.
progressintegerProgress from 0 to 100. It is 0 until the job completes and 100 once it has.
created_atintegerUnix time in seconds at which the job was created.
completed_atinteger | nullUnix time in seconds at which the job completed; null until then.
expires_atinteger | nullUnix time in seconds after which the output expires; null because outputs currently have no expiry.
secondsstringLength of the video in seconds, as a string; for a completed job it is the delivered length.
sizestringResolution of the video as `WIDTHxHEIGHT`; null when the provider did not report one.
promptstring | nullPrompt the job was created with.
remixed_from_video_idnullAlways null; remix is not supported.
errorobject | nullWhy the job failed; null unless status is `failed`.
error.codestringMachine-readable failure code.
error.messagestringHuman-readable failure message.
polling_urlstringRelative URL to poll for the job state; same as retrieveVideo for this job.
unsigned_urlsarray<string>Relative URLs of the finished output; empty until the video is ready. Download them with the same API key.
usageobjectCost of the job; present once a price applies.
usage.costnumberCost of the job in USD: delivered seconds times the per-second price once completed, 0 while running.

Download video content

Call Create video first and replace video_123 with its ID; poll until completed before downloading.

GET /openai/v1/videos/{video_id}/content● Supported

Official OpenAI docs ↗

Request parameters

  • video_idstring必填

    path: Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400.

  • variantany可选◐ Partially supported
    默认 "video"

    query: Spritesheet is not available in this release (400).

    video and thumbnail work; spritesheet returns 400.

    取值 videothumbnailspritesheet
  • indexinteger可选◐ Partially supported

    query: Output index; this release produces index 0. variant takes precedence.

    Video supports index=0 only; positive or negative indices return 400. With variant=thumbnail, index is accepted but currently ignored.

Returns

200

Downloads the video file (video, MP4) or the thumbnail (thumbnail) once the job is completed; spritesheet returns 400 and index supports 0 only. An unknown job returns 404.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Video or thumbnail bytes

video/mp4

NameTypeDescription
$string (binary)

image/jpeg

NameTypeDescription
$string (binary)

Delete video

Call Create video first and replace video_123 with its ID; poll until completed before downloading.

DELETE /openai/v1/videos/{video_id}● Supported

Official OpenAI docs ↗

Request parameters

  • video_idstring必填

    path: Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400.

Returns

200 video.deleted

Deletes the job and its generated content. An unknown job returns 404.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Success

application/json

NameTypeDescription
idstringId of the deleted video job.
objectstringObject type; always `video.deleted`.
deletedbooleanAlways true; the job is no longer readable.

Call Create video first and replace video_123 with its ID; poll until completed before downloading.

POST /openai/v1/videos/{video_id}/remix○ Unsupported

Official OpenAI docs ↗

Request parameters

  • video_idstring必填

    path: Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400.

Returns

400 Remixing is not supported. Do not retry.

Unsupported; the call always returns 400 (invalid_request_error, message "Video remix is not supported"). Do not retry.

Errors follow the OpenAI format — see error codes

Response

This endpoint does not declare a successful response.

Transcribe audio

POST /openai/v1/audio/transcriptions● Supported

Official OpenAI docs ↗

Request body

  • modelstring必填

    Verified to take effect.

  • temperaturenumber可选○ Unsupported

    Both whisper-large-v3-turbo and qwen3-asr-flash return 400.

  • response_formatstring可选◐ Partially supported
    默认 "json"

    json/text work on both; verbose_json works only on whisper-large-v3-turbo. srt/vtt return 400.

    取值 jsontextverbose_json
  • filestring必填

    Verified to take effect.

  • languagestring可选◐ Partially supported

    Both models accept ISO language codes. qwen3-asr-flash may translate output to that language; whisper-large-v3-turbo treats it as an input hint. Non-ISO names may return 502.

  • promptstring可选◐ Partially supported

    Vocabulary hints work on whisper-large-v3-turbo only; qwen3-asr-flash returns 400.

  • timestamp_granularities[]array可选◐ Partially supported

    Only whisper-large-v3-turbo supports segment with verbose_json. word returns 400; qwen3-asr-flash does not support timestamps.

Returns

200

Standard request fields; unrepresentable parameters return input_not_representable.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Transcription in the requested format.

text/plain

NameTypeDescription
$string

application/json

NameTypeDescription
textstring
taskstring
languagestring
durationnumber
segmentsarray<object>
segments[].idinteger
segments[].startnumber
segments[].endnumber
segments[].textstring
segments[].temperaturenumber
segments[].avg_logprobnumber
segments[].compression_rationumber
segments[].no_speech_probnumber

POST /openai/v1/files◐ Partial

Official OpenAI docs ↗

Request body

  • filestring必填

    The File object (not file name) to be uploaded.

    Verified to take effect.

  • purposestring必填◐ Partially supported

    The file purpose: user_data, assistants or vision (vision accepts only PNG, JPEG, GIF or WebP images). Other OpenAI purposes such as batch, fine-tune and evals are not supported and return 400 PURPOSE_UNSUPPORTED.

    Supports user_data, assistants and vision; batch, fine-tune, evals and other values return 400.

    取值 user_dataassistantsvision
  • expires_afterobject可选

    The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted.

    anchor=created_at and seconds=3600–2592000.

    ▸ 展开子字段(2)
    • anchorstring必填

      Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.

      取值 created_at
    • secondsinteger必填

      The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).

Returns

200 file

Upload one file, up to 100 MB (104857600 bytes), using streaming multipart/form-data. Supported content-detected types: PDF; DOCX, XLSX, PPTX; PNG, JPEG, GIF, WebP; MP3, WAV, FLAC, OGG, M4A; MP4, WebM; UTF-8 JSON, NDJSON, CSV, Markdown and plain text. Purposes: user_data, assistants, vision. Other purposes and empty/unsupported/oversized files return 400. OpenAI Uploads chunking is not supported. expires_after accepts anchor created_at and seconds 3600–2592000. Only form file, purpose, expires_after[anchor] and expires_after[seconds] are accepted; any other form field or any query parameter returns 400 invalid_request_error "Unrecognized request argument supplied: <name>" with param naming it.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/json

NameTypeDescription
idstringThe file identifier, which can be referenced in the API endpoints.
bytesintegerThe size of the file, in bytes.
created_atintegerThe Unix timestamp (in seconds) for when the file was created.
expires_atintegerThe Unix timestamp (in seconds) for when the file will expire.
filenamestringThe name of the file.
objectstringThe object type, which is always `file`.
purposestringThe intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
status_detailsstringDeprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.

List files

GET /openai/v1/files● Supported

Official OpenAI docs ↗

Request parameters

  • purposestring可选

    query: Only return files with the given purpose.

    Verified to take effect.

  • limitinteger可选
    默认 10000

    query: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.

    Verified to take effect.

  • orderstring可选
    默认 "desc"

    query: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.

    Verified to take effect.

    取值 ascdesc
  • afterstring可选

    query: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

    Verified to take effect.

Returns

200 list

Only the after, order, limit and purpose query parameters are accepted; any other returns 400 invalid_request_error "Unrecognized request argument supplied: <name>" with param naming it.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/json

NameTypeDescription
objectstring
dataarray<object>
data[].idstringThe file identifier, which can be referenced in the API endpoints.
data[].bytesintegerThe size of the file, in bytes.
data[].created_atintegerThe Unix timestamp (in seconds) for when the file was created.
data[].expires_atintegerThe Unix timestamp (in seconds) for when the file will expire.
data[].filenamestringThe name of the file.
data[].objectstringThe object type, which is always `file`.
data[].purposestringThe intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
data[].statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
data[].status_detailsstringDeprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
first_idstring
last_idstring
has_moreboolean

Retrieve file

Upload a file first, then replace the example file ID with its returned ID.

GET /openai/v1/files/{file_id}● Supported

Official OpenAI docs ↗

Request parameters

  • file_idstring必填

    path: The ID of the file to use for this request.

Returns

200 file

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/json

NameTypeDescription
idstringThe file identifier, which can be referenced in the API endpoints.
bytesintegerThe size of the file, in bytes.
created_atintegerThe Unix timestamp (in seconds) for when the file was created.
expires_atintegerThe Unix timestamp (in seconds) for when the file will expire.
filenamestringThe name of the file.
objectstringThe object type, which is always `file`.
purposestringThe intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
status_detailsstringDeprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.

Delete file

Upload a file first, then replace the example file ID with its returned ID.

DELETE /openai/v1/files/{file_id}● Supported

Official OpenAI docs ↗

Request parameters

  • file_idstring必填

    path: The ID of the file to use for this request.

Returns

200 file

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/json

NameTypeDescription
idstring
objectstring
deletedboolean

Retrieve file content

Upload a file first, then replace the example file ID with its returned ID.

GET /openai/v1/files/{file_id}/content● Supported

Official OpenAI docs ↗

Request parameters

  • file_idstring必填

    path: The ID of the file to use for this request.

Returns

200

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/octet-stream

NameTypeDescription
$string (binary)

Vector stores

The official openai Python SDK can use vector stores, files and batches directly. Both URLs access the same data.

https://api.deepraxis.ai/openai/v1

Quickstart: official Python SDK

Current differences

Search returns chunks, so a file may appear more than once; max_num_results counts chunks. rewrite_query: true first rewrites the query with a small model (billed by model usage; falls back to the original query on failure); the model it uses can only be set through models on the native API, and passing models here returns 400. Search has_more is always false and next_page always null. description is accepted but discarded. expand=files and expand[]=files are Praxis extensions; unknown values are ignored.

Deleted stores are retained for 7 days. Retrieval can still return 200 completed, while writes and search return 409. Use the native API for restore, retry, segments, events and hybrid-search weights. Compatible responses omit praxis, chunk_id, page and span. usage_bytes counts extracted chunk text bytes. Unknown request fields are currently ignored.

Native API · Errors

MethodPathOperation
POST/openai/v1/vector_storesCreate knowledge base
GET/openai/v1/vector_storesList knowledge bases
GET/openai/v1/vector_stores/{vector_store_id}Retrieve knowledge base
POST/openai/v1/vector_stores/{vector_store_id}Update knowledge base
DELETE/openai/v1/vector_stores/{vector_store_id}Delete knowledge base
POST/openai/v1/vector_stores/{vector_store_id}/searchSearch knowledge base
POST/openai/v1/vector_stores/{vector_store_id}/filesAdd file
GET/openai/v1/vector_stores/{vector_store_id}/filesList files
GET/openai/v1/vector_stores/{vector_store_id}/files/{file_id}Retrieve file
POST/openai/v1/vector_stores/{vector_store_id}/files/{file_id}Update file attributes
DELETE/openai/v1/vector_stores/{vector_store_id}/files/{file_id}Remove file
GET/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/contentRead extracted content
POST/openai/v1/vector_stores/{vector_store_id}/file_batchesCreate file batch
GET/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}Retrieve file batch
POST/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancelCancel file batch
GET/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/filesList batch files

Create knowledge base

POST /openai/v1/vector_stores

Create a knowledge base, optionally starting ingestion of uploaded file_ids in the same call; no separate attachment or batch is needed for those files. Use the returned id with vectorStores.files.retrieve to poll each attachment until completed, failed or cancelled; store status=completed alone does not mean every file succeeded. Unlike OpenAI vector stores, each file is limited to 100000000 bytes and each account to 100 active/nondeleted stores. Minimal body: {"name":"Refund policies"}.

Request body

FieldTypeDescription
namestringoptional; Omitted name becomes an empty string; null is rejected.; max characters: 256; default: ""
metadataobject / nulloptional; User-defined string metadata for the store; omission or null creates an empty map.; default: {}
expires_afterobject / nulloptional; Expiry policy from last activity; omission or null disables automatic expiry.; default: null
expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365
file_idsstring[]optional; Existing File IDs to attach; the store allows up to 10,000 files.
chunking_strategyobject / objectoptional; auto resolves to static with 800 estimated tokens and 400 overlap tokens. Unlike OpenAI vector stores, token counts are estimates; each Han character counts as one, and other whitespace-delimited words count as their UTF-16 length divided by four, rounded up.; default: {"type":"auto"}
chunking_strategy (1).type"auto"required; auto uses the default static chunk size of 800 estimated tokens with 400 overlap tokens.
chunking_strategy (2).type"static"required; static selects explicit chunk-size and overlap settings.
chunking_strategy (2).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
chunking_strategy (2).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
chunking_strategy (2).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
descriptionstringoptional; ignored: Accepted but not saved or returned; its type is not validated.

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"name\":\"Refund policies\"}"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store"required; Object discriminator; vector_store identifies a knowledge base.
namestringrequired; Display name of the knowledge base; an empty string means no name was set.; max characters: 256
status"in_progress" / "completed" / "expired"required; in_progress means at least one file is ingesting; completed means no file is ingesting, even if some failed; expired means the expiry policy has taken effect.
usage_bytesintegerrequired; Sum of completed source file sizes in bytes.; min: 0
file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
created_atintegerrequired; Unix timestamp in seconds.
last_active_atinteger / nullrequired; Most recent creation, file attachment or search time in Unix seconds; null when unavailable.
expires_afterobject / nullrequired; Expiry policy measured from last activity; null disables automatic expiry.
expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365
expires_atinteger / nullrequired; Scheduled expiry time in Unix seconds; null when no expiry policy is set.
metadataobjectrequired; Up to 16 keys; keys up to 64 characters; string values up to 512 characters.; max keys: 16; Key length ≤ 64; Values: string

Error codes and objects

List knowledge bases

GET /openai/v1/vector_stores

Lists knowledge bases visible to the caller, newest first by default. Use last_id as after to read the next page; for example, ?limit=20.

Parameters

NameLocation and typeDescription
afterquery: stringCursor ID from the previous page. min characters: 1
beforequery: stringReturn items before this ID. min characters: 1
limitquery: integerPage size. min: 1; max: 100; default: 20
orderquery: "asc" / "desc"Order by creation time; defaults to desc for stores/files and asc by index for segments. default: "desc"

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
object"list"required; Object discriminator; list identifies a cursor-paginated collection.
dataobject[]required; Current page of knowledge bases in the requested order.
data[].idstringrequired; Resource ID.; min characters: 1
data[].object"vector_store"required; Object discriminator; vector_store identifies a knowledge base.
data[].namestringrequired; Display name of the knowledge base; an empty string means no name was set.; max characters: 256
data[].status"in_progress" / "completed" / "expired"required; in_progress means at least one file is ingesting; completed means no file is ingesting, even if some failed; expired means the expiry policy has taken effect.
data[].usage_bytesintegerrequired; Sum of completed source file sizes in bytes.; min: 0
data[].file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
data[].file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
data[].file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
data[].file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
data[].file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
data[].file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
data[].created_atintegerrequired; Unix timestamp in seconds.
data[].last_active_atinteger / nullrequired; Most recent creation, file attachment or search time in Unix seconds; null when unavailable.
data[].expires_afterobject / nullrequired; Expiry policy measured from last activity; null disables automatic expiry.
data[].expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
data[].expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365
data[].expires_atinteger / nullrequired; Scheduled expiry time in Unix seconds; null when no expiry policy is set.
data[].metadataobjectrequired; Up to 16 keys; keys up to 64 characters; string values up to 512 characters.; max keys: 16; Key length ≤ 64; Values: string
first_idstring / nullrequired; ID of the first item on this page; null for an empty page.
last_idstring / nullrequired; ID of the last item on this page; use as after to continue. Null for an empty page.
has_morebooleanrequired; Whether additional items remain after this page within the selected cursor range.

Error codes and objects

Retrieve knowledge base

GET /openai/v1/vector_stores/{vector_store_id}

Retrieves a knowledge base using an id returned by create or list. Add ?expand=files to include the first page of attached files. Deleted stores return 404.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
expandquery: "files"[]Praxis extension on both URLs: files includes the first file page. Unknown values are ignored.
expand[]query: "files"[]Praxis extension on both URLs: files includes the first file page. Unknown values are ignored.

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
(1).idstringrequired; Resource ID.; min characters: 1
(1).object"vector_store"required; Object discriminator; vector_store identifies a knowledge base.
(1).namestringrequired; Display name of the knowledge base; an empty string means no name was set.; max characters: 256
(1).status"in_progress" / "completed" / "expired"required; in_progress means at least one file is ingesting; completed means no file is ingesting, even if some failed; expired means the expiry policy has taken effect.
(1).usage_bytesintegerrequired; Sum of completed source file sizes in bytes.; min: 0
(1).file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
(1).file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
(1).file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
(1).file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
(1).file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
(1).file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
(1).created_atintegerrequired; Unix timestamp in seconds.
(1).last_active_atinteger / nullrequired; Most recent creation, file attachment or search time in Unix seconds; null when unavailable.
(1).expires_afterobject / nullrequired; Expiry policy measured from last activity; null disables automatic expiry.
(1).expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
(1).expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365
(1).expires_atinteger / nullrequired; Scheduled expiry time in Unix seconds; null when no expiry policy is set.
(1).metadataobjectrequired; Up to 16 keys; keys up to 64 characters; string values up to 512 characters.; max keys: 16; Key length ≤ 64; Values: string
(2).filesobjectoptional; First page of files, only when expand=files.
(2).files.object"list"required; Object discriminator; list identifies a cursor-paginated collection.
(2).files.dataobject[]required; Current page of attached files in the requested order.
(2).files.data[].idstringrequired; Same ID as the source File.; min characters: 1
(2).files.data[].object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
(2).files.data[].vector_store_idstringrequired; Resource ID.; min characters: 1
(2).files.data[].status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
(2).files.data[].last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
(2).files.data[].last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
(2).files.data[].last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
(2).files.data[].usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
(2).files.data[].created_atintegerrequired; Unix timestamp in seconds.
(2).files.data[].chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
(2).files.data[].chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
(2).files.data[].chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
(2).files.data[].chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
(2).files.data[].chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
(2).files.data[].chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
(2).files.data[].attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.
(2).files.first_idstring / nullrequired; ID of the first item on this page; null for an empty page.
(2).files.last_idstring / nullrequired; ID of the last item on this page; use as after to continue. Null for an empty page.
(2).files.has_morebooleanrequired; Whether additional items remain after this page within the selected cursor range.

Error codes and objects

Update knowledge base

POST /openai/v1/vector_stores/{vector_store_id}

Updates an active knowledge base using its returned id. Omitted fields stay unchanged; metadata replaces the whole map. Example body: {"name":"Refund policies"}.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1

Request body

FieldTypeDescription
namestring / nulloptional; null clears the name to an empty string. Omitted fields stay unchanged.
metadataobject / nulloptional; Replaces all metadata; null clears it to an empty object.
expires_afterobject / nulloptional; null removes automatic expiry.
expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"name\":\"Support policies\"}"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store"required; Object discriminator; vector_store identifies a knowledge base.
namestringrequired; Display name of the knowledge base; an empty string means no name was set.; max characters: 256
status"in_progress" / "completed" / "expired"required; in_progress means at least one file is ingesting; completed means no file is ingesting, even if some failed; expired means the expiry policy has taken effect.
usage_bytesintegerrequired; Sum of completed source file sizes in bytes.; min: 0
file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
created_atintegerrequired; Unix timestamp in seconds.
last_active_atinteger / nullrequired; Most recent creation, file attachment or search time in Unix seconds; null when unavailable.
expires_afterobject / nullrequired; Expiry policy measured from last activity; null disables automatic expiry.
expires_after (1).anchor"last_active_at"required; last_active_at measures expiry from the most recent activity timestamp.
expires_after (1).daysintegerrequired; Days since last activity; attaching files and searching refresh activity.; min: 1; max: 365
expires_atinteger / nullrequired; Scheduled expiry time in Unix seconds; null when no expiry policy is set.
metadataobjectrequired; Up to 16 keys; keys up to 64 characters; string values up to 512 characters.; max keys: 16; Key length ≤ 64; Values: string

Error codes and objects

Delete knowledge base

DELETE /openai/v1/vector_stores/{vector_store_id}

Deletes the store. Subsequent retrieve and repeat DELETE return 404 not_found_error; lists exclude deleted stores. Native restore remains available for 7 days.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1

Request example

curl -X DELETE "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store.deleted"required; Object discriminator; vector_store.deleted identifies this deletion receipt.
deletedtruerequired; Confirms deletion on the compatible surface; subsequent access returns not found.

Error codes and objects

Search knowledge base

POST /openai/v1/vector_stores/{vector_store_id}/search

Search ingested files, grouping matched chunks by file with chunks sorted by score in content. max_num_results counts files; up to 50 candidate chunks are grouped. Unlike OpenAI vector stores, this compatible URL rejects ranking_options.hybrid_search with 400 INVALID_PARAMS and does not paginate; has_more reports truncated files but next_page remains null. Use /knowledge/v1 for hybrid weights and per-chunk results. Only ranker default-2024-11-15 requests reranking; auto, none and omission use the initial ranking.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1

Request body

FieldTypeDescription
querystring / string[]required; Nonblank text. Multiple queries are joined with newlines for one search.
filtersobject / object / objectoptional; Type-strict file attribute filters. At most 20 nested levels below the root.
filters (1).type"eq" / "ne" / "gt" / "gte" / "lt" / "lte"required; eq means equal, ne not equal, gt greater, gte greater or equal, lt less, and lte less or equal. The attribute must exist and have the same value type.
filters (1).keystringrequired; Literal file-attribute key to compare, including any punctuation in the key.; min characters: 1
filters (1).valuestring / number / booleanrequired; Scalar value compared without type coercion.
filters (2).type"in" / "nin"required; in matches an attribute equal to an array member; nin matches an attribute unequal to every member. Missing attributes never match.
filters (2).keystringrequired; Literal file-attribute key to compare, including any punctuation in the key.; min characters: 1
filters (2).valuestring / number[]required; String or number values tested for membership without type coercion.
filters (3).type"and" / "or"required; and requires every child filter to match; or requires at least one child filter to match.
filters (3).filtersobject / object / object[]required; Nonempty child-filter list combined using the selected and/or operator.; min items: 1
filters (3).filters[]object / object / objectRepeat the same filter structure; nesting limit is 20.
max_num_resultsintegeroptional; Maximum unique files after grouping the retrieved chunks (up to 50 candidate chunks).; min: 1; max: 50; default: 10
rewrite_querybooleanoptional; supported: When true, the store's query_rewrite model first rewrites each query into a concise search query; retrieval uses the rewrite and search_query returns it. Each rewrite is one small model call billed by model usage. If a rewrite fails, times out (5 s) or is empty, that query falls back to the original text and the search still succeeds. Omitted or false makes no model call.
next_pagestringoptional; ignored: Unlike OpenAI vector stores, search has no next page; supplying this cursor has no effect. Narrow the query or filters to inspect other matches.
ranking_optionsobjectoptional; Controls result ranking and the minimum score required for inclusion.
ranking_options.ranker"none" / "auto" / "default-2024-11-15"optional; Unlike OpenAI, auto does not select a reranker. Only default-2024-11-15 requests reranking; none, auto and omission use the initial ranking. Reranking effect has not been measured separately.
ranking_options.score_thresholdnumberoptional; Minimum score. Scores are not relevance probabilities; threshold effect has not been measured separately.; min: 0; max: 1; default: 0
ranking_options.hybrid_searchobjectoptional; unsupported: Rejected with 400 INVALID_PARAMS on /openai/v1. Use /knowledge/v1 for weights.; Praxis extension
ranking_options.hybrid_search.embedding_weightnumberrequired; Relative weight of semantic retrieval; zero disables semantic retrieval.; min: 0; default: 0.7
ranking_options.hybrid_search.text_weightnumberrequired; Relative weight of keyword retrieval; zero disables keyword retrieval.; min: 0; default: 0.3
praxisobjectoptional; ignored: Compatibility responses remove praxis, including explanations.
praxis.explainbooleanoptional; Requests explanations internally; the compatible response omits them.

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/search" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"query\":\"When will I receive my refund?\",\"max_num_results\":5}"

Response

HTTP 200

FieldTypeDescription
object"vector_store.search_results.page"required; Object discriminator; vector_store.search_results.page identifies a search result page.
search_querystring[]required; The queries used for retrieval, one per input query; rewritten when rewrite_query is true, otherwise the input as sent.
dataobject[]required; One result per unique file; content contains its matched chunks.
data[].file_idstringrequired; Resource ID.; min characters: 1
data[].filenamestringrequired; Original source filename for the matched file.
data[].scorenumberrequired; Highest matched chunk score for this file.; min: 0; max: 1
data[].attributesobject / nullrequired; Current file attributes used for filtering; null when unset.
data[].contentobject[]required; Matched chunks in descending chunk-score order.
data[].content[].type"text"required; text identifies an extracted text chunk.
data[].content[].textstringrequired; Extracted text of the matched chunk, which may overlap neighboring chunks.
has_morebooleanrequired; True when filtered files exceed max_num_results; next_page remains null.; supported:
next_pagenullrequired; ignored: Always null; no next search page.

Error codes and objects

Add file

POST /openai/v1/vector_stores/{vector_store_id}/files

Attach an uploaded File for asynchronous ingestion, then poll this attachment until status is completed, failed or cancelled before searching. Unlike OpenAI vector stores, the file limit is 100000000 bytes; chunk sizes use estimated tokens rather than a model tokenizer. Text, Markdown, CSV, JSON, HTML, PDF, DOCX, PPTX, XLSX and PNG/JPEG/GIF/WebP images can be extracted; audio and video uploads are not knowledge documents. Images may yield generated descriptions rather than verbatim OCR. auto chunking resolves to static 800/400; explicit sizes are 100–4096 with overlap at most half the size. Each store holds at most 10000 attached files. Reattaching the same file returns its existing record without applying new attributes or chunking; inspect last_error after failure.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1

Request body

FieldTypeDescription
file_idstringrequired; Existing source File ID returned by file upload; the file must be visible to the caller.; min characters: 1
attributesobject / nulloptional; Search-filter attributes for a newly attached file; omission or null leaves attributes unset. Reattaching an existing file does not change them.
chunking_strategyobject / objectoptional; auto resolves to static with 800 estimated tokens and 400 overlap tokens. Unlike OpenAI vector stores, token counts are estimates; each Han character counts as one, and other whitespace-delimited words count as their UTF-16 length divided by four, rounded up.; default: {"type":"auto"}
chunking_strategy (1).type"auto"required; auto uses the default static chunk size of 800 estimated tokens with 400 overlap tokens.
chunking_strategy (2).type"static"required; static selects explicit chunk-size and overlap settings.
chunking_strategy (2).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
chunking_strategy (2).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
chunking_strategy (2).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file_id\":\"${FILE_ID}\"}"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Same ID as the source File.; min characters: 1
object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
created_atintegerrequired; Unix timestamp in seconds.
chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.

Error codes and objects

List files

GET /openai/v1/vector_stores/{vector_store_id}/files

Lists attached files and their ingestion status, newest attachment first by default. Use last_id as after to continue; ?filter=failed selects files that can be retried.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
afterquery: stringCursor ID from the previous page. min characters: 1
beforequery: stringReturn items before this ID. min characters: 1
limitquery: integerPage size. min: 1; max: 100; default: 20
orderquery: "asc" / "desc"Order by creation time; defaults to desc for stores/files and asc by index for segments. default: "desc"
filterquery: "in_progress" / "completed" / "failed" / "cancelled"in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation. Omit to include all statuses.

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
object"list"required; Object discriminator; list identifies a cursor-paginated collection.
dataobject[]required; Current page of attached files in the requested order.
data[].idstringrequired; Same ID as the source File.; min characters: 1
data[].object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
data[].vector_store_idstringrequired; Resource ID.; min characters: 1
data[].status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
data[].last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
data[].last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
data[].last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
data[].usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
data[].created_atintegerrequired; Unix timestamp in seconds.
data[].chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
data[].chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
data[].chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
data[].chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
data[].chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
data[].chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
data[].attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.
first_idstring / nullrequired; ID of the first item on this page; null for an empty page.
last_idstring / nullrequired; ID of the last item on this page; use as after to continue. Null for an empty page.
has_morebooleanrequired; Whether additional items remain after this page within the selected cursor range.

Error codes and objects

Retrieve file

GET /openai/v1/vector_stores/{vector_store_id}/files/{file_id}

Retrieves an attached file using the id returned by attachment or file listing. Poll this operation until status leaves in_progress to observe the ingestion outcome.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
file_idpath: stringRequired; Source File ID of an attachment, returned by file attachment or listing. min characters: 1

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files/${FILE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Same ID as the source File.; min characters: 1
object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
created_atintegerrequired; Unix timestamp in seconds.
chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.

Error codes and objects

Update file attributes

POST /openai/v1/vector_stores/{vector_store_id}/files/{file_id}

Replaces search-filter attributes of an existing attachment without reingesting its content. Use an attached file id. Example body: {"attributes":{"category":"refund"}}; null clears the attributes.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
file_idpath: stringRequired; Source File ID of an attachment, returned by file attachment or listing. min characters: 1

Request body

FieldTypeDescription
attributesobject / nulloptional; Replaces all search-filter attributes; null clears them.

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files/${FILE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"attributes\":{\"category\":\"refund\"}}"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Same ID as the source File.; min characters: 1
object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
created_atintegerrequired; Unix timestamp in seconds.
chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.

Error codes and objects

Remove file

DELETE /openai/v1/vector_stores/{vector_store_id}/files/{file_id}

Removes the file from search immediately; does not delete the original File.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
file_idpath: stringRequired; Source File ID of an attachment, returned by file attachment or listing. min characters: 1

Request example

curl -X DELETE "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files/${FILE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store.file.deleted"required; Object discriminator; vector_store.file.deleted identifies this deletion receipt.
deletedtruerequired; Confirms removal from this knowledge base; the source File is not deleted.

Error codes and objects

Read extracted content

GET /openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content

Extracted text chunks may overlap. Image content can be a generated description rather than verbatim OCR.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
file_idpath: stringRequired; Source File ID of an attachment, returned by file attachment or listing. min characters: 1

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/files/${FILE_ID}/content" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
object"vector_store.file_content.page"required; Object discriminator; vector_store.file_content.page identifies extracted file content.
dataobject[]required; All currently stored text chunks in segment-index order; neighboring chunks may overlap.
data[].type"text"required; text identifies an extracted text chunk.
data[].textstringrequired; Extracted text of this chunk; may overlap neighboring chunks.
has_morefalserequired; Always false; all currently stored chunks are returned in this response.
next_pagenullrequired; Always null because extracted content is not paginated.

Error codes and objects

Create file batch

POST /openai/v1/vector_stores/{vector_store_id}/file_batches

Attaches existing Files as a batch for asynchronous ingestion. Supply exactly one of file_ids or files; files allows per-file settings. Existing attachments are reused. Read the returned batch id to monitor status.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1

Request body

Provide exactly one of file_ids or files. Already attached files are reused without changing their attributes or chunking.

FieldTypeDescription
(1).file_idsstring[]required; Existing File IDs to attach with shared attributes and chunking settings. Supply file_ids or files, never both.; min items: 1; max items: 500
(1).attributesobject / nulloptional; Search-filter attributes applied to each newly attached file; omission or null leaves them unset.
(1).chunking_strategyobject / objectoptional; auto resolves to static with 800 estimated tokens and 400 overlap tokens. Unlike OpenAI vector stores, token counts are estimates; each Han character counts as one, and other whitespace-delimited words count as their UTF-16 length divided by four, rounded up.; default: {"type":"auto"}
(1).chunking_strategy (1).type"auto"required; auto uses the default static chunk size of 800 estimated tokens with 400 overlap tokens.
(1).chunking_strategy (2).type"static"required; static selects explicit chunk-size and overlap settings.
(1).chunking_strategy (2).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
(1).chunking_strategy (2).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
(1).chunking_strategy (2).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
(2).filesobject[]required; Files to attach with individual attributes and chunking settings; top-level attributes and chunking_strategy are ignored.; min items: 1; max items: 500
(2).files[].file_idstringrequired; Existing source File ID returned by file upload; the file must be visible to the caller.; min characters: 1
(2).files[].attributesobjectoptional; File attributes used by search filters. Up to 16 keys of 64 characters; string values up to 512 characters.; max keys: 16; Key length ≤ 64; Values: string / number / boolean
(2).files[].chunking_strategyobject / objectoptional; auto resolves to static with 800 estimated tokens and 400 overlap tokens. Unlike OpenAI vector stores, token counts are estimates; each Han character counts as one, and other whitespace-delimited words count as their UTF-16 length divided by four, rounded up.; default: {"type":"auto"}
(2).files[].chunking_strategy (1).type"auto"required; auto uses the default static chunk size of 800 estimated tokens with 400 overlap tokens.
(2).files[].chunking_strategy (2).type"static"required; static selects explicit chunk-size and overlap settings.
(2).files[].chunking_strategy (2).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
(2).files[].chunking_strategy (2).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
(2).files[].chunking_strategy (2).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
(2).attributesJSONoptional; ignored: Ignored when files is supplied.
(2).chunking_strategyJSONoptional; ignored: Ignored when files is supplied.

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/file_batches" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file_ids\":[\"${FILE_ID}\"]}"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store.files_batch"required; Object discriminator; vector_store.files_batch identifies a batch of attached files.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; cancelled means the batch was cancelled; otherwise in_progress means a member is still ingesting, failed means ingestion ended with failed members, and completed means no pending or failed members remain. Cancelling a terminal batch leaves it unchanged.
file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
created_atintegerrequired; Unix timestamp in seconds.

Error codes and objects

Retrieve file batch

GET /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}

Retrieves a batch created in this knowledge base, including current status and file counts. Use the batch id returned by batch creation to monitor ingestion.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
batch_idpath: stringRequired; File-batch ID returned by batch creation in this knowledge base. min characters: 1

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/file_batches/${BATCH_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store.files_batch"required; Object discriminator; vector_store.files_batch identifies a batch of attached files.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; cancelled means the batch was cancelled; otherwise in_progress means a member is still ingesting, failed means ingestion ended with failed members, and completed means no pending or failed members remain. Cancelling a terminal batch leaves it unchanged.
file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
created_atintegerrequired; Unix timestamp in seconds.

Error codes and objects

Cancel file batch

POST /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel

Cancels only in-progress batches and pending files. Completed, failed and cancelled batches return unchanged (200, idempotent).

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
batch_idpath: stringRequired; File-batch ID returned by batch creation in this knowledge base. min characters: 1

Request example

curl -X POST "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/file_batches/${BATCH_ID}/cancel" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
idstringrequired; Resource ID.; min characters: 1
object"vector_store.files_batch"required; Object discriminator; vector_store.files_batch identifies a batch of attached files.
vector_store_idstringrequired; Resource ID.; min characters: 1
status"in_progress" / "completed" / "cancelled" / "failed"required; cancelled means the batch was cancelled; otherwise in_progress means a member is still ingesting, failed means ingestion ended with failed members, and completed means no pending or failed members remain. Cancelling a terminal batch leaves it unchanged.
file_countsobjectrequired; Counts of files still attached to the store or batch, grouped by ingestion status.
file_counts.in_progressintegerrequired; Number of files waiting for or undergoing ingestion.; min: 0
file_counts.completedintegerrequired; Number of files whose ingestion completed.; min: 0
file_counts.failedintegerrequired; Number of files whose ingestion failed.; min: 0
file_counts.cancelledintegerrequired; Number of files stopped by batch cancellation.; min: 0
file_counts.totalintegerrequired; Total attached files across all ingestion statuses.; min: 0
created_atintegerrequired; Unix timestamp in seconds.

Error codes and objects

List batch files

GET /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files

Lists files still attached from the identified batch, newest attachment first by default. Use the batch creation id and ?filter=failed to inspect failures; last_id is the next after cursor.

Parameters

NameLocation and typeDescription
vector_store_idpath: stringRequired; Knowledge-base ID returned by create or list; use the ID rather than its display name. min characters: 1
batch_idpath: stringRequired; File-batch ID returned by batch creation in this knowledge base. min characters: 1
afterquery: stringCursor ID from the previous page. min characters: 1
beforequery: stringReturn items before this ID. min characters: 1
limitquery: integerPage size. min: 1; max: 100; default: 20
orderquery: "asc" / "desc"Order by creation time; defaults to desc for stores/files and asc by index for segments. default: "desc"
filterquery: "in_progress" / "completed" / "failed" / "cancelled"in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation. Omit to include all statuses.

Request example

curl -X GET "https://api.deepraxis.ai/openai/v1/vector_stores/${VECTOR_STORE_ID}/file_batches/${BATCH_ID}/files" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

Response

HTTP 200

FieldTypeDescription
object"list"required; Object discriminator; list identifies a cursor-paginated collection.
dataobject[]required; Current page of attached files in the requested order.
data[].idstringrequired; Same ID as the source File.; min characters: 1
data[].object"vector_store.file"required; Object discriminator; vector_store.file identifies a file attached to a knowledge base.
data[].vector_store_idstringrequired; Resource ID.; min characters: 1
data[].status"in_progress" / "completed" / "cancelled" / "failed"required; in_progress means ingestion is pending or running; completed means searchable; failed means ingestion failed; cancelled means ingestion was stopped by batch cancellation.
data[].last_errorobject / nullrequired; Ingestion failure details; null before a failure and after a successful ingestion or retry.
data[].last_error (1).code"server_error" / "unsupported_file" / "invalid_file"required; unsupported_file means the file type is unsupported; invalid_file means encrypted, empty or over the parsed-token limit; server_error covers other ingestion failures and deadline expiry.
data[].last_error (1).messagestringrequired; Explanation of the ingestion failure associated with code.
data[].usage_bytesintegerrequired; Original source file size in bytes after completion; zero while pending, failed or cancelled.; min: 0
data[].created_atintegerrequired; Unix timestamp in seconds.
data[].chunking_strategyobject / objectrequired; Stored chunking strategy for this attachment; auto input is returned as static settings.
data[].chunking_strategy (1).type"static"required; static selects explicit chunk-size and overlap settings.
data[].chunking_strategy (1).staticobjectrequired; Chunk-size and overlap limits in estimated tokens.
data[].chunking_strategy (1).static.max_chunk_size_tokensintegerrequired; Estimated tokens per chunk.; min: 100; max: 4096
data[].chunking_strategy (1).static.chunk_overlap_tokensintegerrequired; Must not exceed half of max_chunk_size_tokens.; min: 0; max: 2048
data[].chunking_strategy (2).type"other"required; other identifies a stored strategy whose chunk-size settings are unavailable.
data[].attributesobject / nullrequired; File attributes used for search filtering; null means no attributes are set.
first_idstring / nullrequired; ID of the first item on this page; null for an empty page.
last_idstring / nullrequired; ID of the last item on this page; use as after to continue. Null for an empty page.
has_morebooleanrequired; Whether additional items remain after this page within the selected cursor range.

Error codes and objects