---
title: "Create Response"
method: POST
path: "/v3/responses"
tags: ["Responses"]
---

# Create Response

`POST /v3/responses`

## Request

- Base URL: `https://api.edenai.run`
- URL: `https://api.edenai.run/v3/responses`
- Auth: HTTP bearer

Create a model response.

## Request body

- ResponsesBody
  - `tags` unknown
  - `routing` ProviderRoutingPreferences: How to choose between SELLERS of one model — and, with ``@edenai``, how far to trade quality for cost when the platform chooses the model. ``order``, ``allowed_providers``, ``ignored_providers`` and ``max_price`` shape WHICH sellers and in what order; ``sort`` ranks the rest. The seller fields are only meaningful when `model` is a canonical name (`gpt-5.5`) rather than a concrete `provider/model` — with a concrete id there is nothing to choose between. For choosing the MODEL itself see ``router_candidates`` and ``model="@edenai"``, which is a different router; ``quality_cost`` below is the one field here that speaks to it.
    - `sort` 'cost' | 'speed' | 'latency' | 'exact', nullable: What to optimise for when several providers serve the requested model. 'cost' (default) picks the cheapest for this request's shape; 'speed' the highest tokens/second; 'latency' the fastest to first token; 'exact' the most reliable at producing well-formed tool calls / structured output. Health is always a filter first — no mode will route you to a failing provider. Can also be written as a model suffix, e.g. 'gpt-5.5:speed'.
    - `sticky` boolean, nullable: Keep a conversation on the provider holding its prompt cache. On by default, and only ever active for models whose providers discount cache reads. Set false to route every request independently on price instead. Naming an explicit `sort` or an `order` also takes priority over cache affinity.
    - `allow_fallbacks` boolean, nullable: Whether other providers of the same model may be tried when the chosen one fails. On by default. Set false to pin the request to the single best provider: it then fails rather than silently moving to another seller, useful when a cache-warm prompt would cold-miss elsewhere. This governs PROVIDERS of the requested model only; models you list in `fallbacks` are your own choice and are always kept.
    - `quality_cost` integer, nullable: Only with model='@edenai': how far to trade answer quality for cost when the platform chooses the MODEL. 0 asks for the best model for the request, 10 for the cheapest model that can still handle it, values in between blend the two; omit it to leave the choice to the platform (quality first). This is the one `routing` field that steers the model rather than the provider — `sort` never changes which model is chosen.
    - `allowed_providers` string[], nullable: Restrict routing to these providers, e.g. ['openai', 'anthropic']. Only providers that serve the requested model are considered, so an entry that does not sell it is simply inert. If none of them do, the request fails rather than falling back to a provider you excluded. Case-insensitive. Applies to routed providers only. a concrete 'provider/model' you named in `fallbacks` is your own choice and is kept.
    - `zero_data_retention` boolean, nullable: Serve this request only from providers that keep no prompts or outputs, and save neither its content nor its response. Applies to every model in the request, including a concrete 'provider/model' and your `fallbacks`: one that is not zero data retention fails the request. It can only add the restriction. When your organization requires zero data retention, `false` does not lift it.
    - `ignored_providers` string[], nullable: Never route to these providers, e.g. ['deepinfra']. The mirror of `allowed_providers`: an entry that does not sell the requested model is inert, and if the list removes every seller the request fails rather than falling back to one you excluded. Case-insensitive. A provider named in both lists is a validation error. A concrete 'provider/model' you named in `fallbacks` is your own choice and is kept.
    - `order` string[], nullable: Providers to try first, in this order, e.g. ['azure', 'openai']. They become the head of the fallback chain; the remaining providers of the model follow, ranked by `sort` (or load-balanced on price when no `sort` is given). An entry that does not sell the model is inert. A provider our health data marks as down is moved to the end of the chain whatever its position here. Naming an `order` turns cache affinity off, as naming a `sort` does. Case-insensitive.
    - `max_price` MaxPrice: A price ceiling in USD per MILLION tokens, one bar per direction, either one optional. Unknown keys are refused: a typo on one side (``ouput``) must not silently remove that bar.
      - `input` number, nullable: Highest input rate accepted, in USD per million tokens.
      - `output` number, nullable: Highest output rate accepted, in USD per million tokens.
  - `fallbacks` string[], nullable: List of fallback model IDs to try if the primary model fails. Models are tried in order. Example: ['anthropic/claude-3-opus', 'openai/gpt-4o']
  - `session_id` string, nullable: Identifies a conversation, so its requests keep reaching the provider that holds its prompt cache. Any stable string you choose — a thread id, a ticket number, an agent run. Also accepted as the `x-session-id` header, for clients that cannot add body fields, and read from the headers coding agents already send (`x-claude-code-session-id`, `x-session-affinity`, `session-id`, `session_id`, and `x-client-request-id` from pi and Codex); the body field wins if both are sent. Without one, a conversation is recognised from its opening messages instead.
  - `router_candidates` string[], nullable: Models the '@edenai' router may choose BETWEEN — it picks the model, whereas `routing` picks the provider for a model you already named. Used only when model='@edenai'. Each entry is a bare model name (e.g. 'gpt-5.5' — the winner's provider is then picked like any provider-less request) or a 'provider/model' id (e.g. 'openai/gpt-5-nano' — the winner is served by that exact provider). Entries the router cannot rank are skipped and listed under `edenai_metadata.routing.auto.dropped`; entries naming a model already in the list collapse into its earliest spelling, which decides how the winner is returned. The request fails only when no entry is left. If not provided, the router chooses from a default pool of eligible catalog models. At most 64 entries of up to 128 characters each.
  - `pre_hooks` object[], nullable: List of hooks to run before the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'pdf_text_extract', 'params': {'method': 'default'}}]
  - `post_hooks` object[], nullable: List of hooks to run after the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'json_heal', 'params': {'json_schema': {...}}}]
  - `model` string, required: Model identifier, e.g. 'openai/gpt-4o'
  - `input` union: Text, image, or file inputs to the model. Optional when continuing a conversation via previous_response_id.
    - string
    - union[]
      - union
        - EasyInputMessage
          - `role` 'user' | 'assistant' | 'system' | 'developer', required
          - `content` union, required
            - string
            - union[]
              - …
          - `type` 'message'
          - `id` string, nullable
          - `status` string, nullable
          - `cache_control` CacheControl: Prompt-cache marker. Marks a message (or content part) as a cache boundary so that the prefix up to that point is stored and reused on subsequent requests, reducing latency and cost. Only a single contiguous cache-marked block is stored per request, and providers enforce a minimum token count below which caching is silently skipped. Silently ignored by providers that don't support prompt caching.
            - `type` 'ephemeral', required: Cache type. Currently only 'ephemeral' is supported.
            - `ttl` string, nullable: Optional cache time-to-live, e.g. '3600s'. Provider-dependent.
        - ResponseInputItem: Non-message input item forwarded to the provider as-is (reasoning, function_call, etc.).
          - `type` string, required
          - `id` string, nullable
  - `instructions` string, nullable: System/developer instructions prepended to input. Not carried over when using previous_response_id.
  - `previous_response_id` string, nullable: ID of a prior response to continue a multi-turn conversation. The provider manages conversation state server-side.
  - `stream` boolean, nullable: Whether to stream the response via server-sent events.
  - `tools` object[], nullable: List of tools the model may call (function, web_search, file_search, etc.).
  - `tool_choice` union: Controls which tool is called. 'auto', 'required', 'none', or a specific tool object.
    - string
    - object
  - `temperature` number, nullable
  - `top_p` number, nullable
  - `max_output_tokens` integer, nullable
  - `reasoning` object, nullable: Reasoning configuration, e.g. {'effort': 'low'|'medium'|'high'}.
  - `truncation` 'auto' | 'disabled', nullable: How to handle context that exceeds the model's context window.
  - `store` boolean, nullable: Whether the provider should store the response server-side for later retrieval.
  - `metadata` object, nullable: Up to 16 key-value pairs for tagging.
  - `user` string, nullable: Stable end-user identifier for abuse detection.
  - `prompt_cache_key` string, nullable: Prompt-cache routing hint (OpenAI): requests sharing a key and a common prompt prefix are routed to the same cache shard, improving hit rates for high-volume shared prefixes. Forwarded to providers that support it, dropped elsewhere. Also read for provider stickiness when no `session_id` or session header is given.
  - `prompt_cache_retention` union: How long the provider retains the prompt cache — OpenAI currently accepts "in_memory" (provider default, typically 5-10 minutes) and "24h" (extended retention, supported on gpt-5.x and gpt-4.1). The known values are advertised in the schema but not enforced: the value is passed through verbatim for the provider to validate, so new provider values work without an Eden AI release. Dropped for providers that don't support it.
    - 'in_memory' | '24h'
    - string
  - `prompt_cache_options` PromptCacheOptions: Request-level prompt-cache settings (OpenAI GPT-5.6 and newer). Controls how this request's prompt cache behaves — whether caching happens automatically or only on the blocks you mark with ``prompt_cache_breakpoint``, and how long the cache is kept. Ignored by models that don't support prompt caching.
    - `mode` union: "implicit" (default) caches automatically and also honors any prompt_cache_breakpoint you set; "explicit" caches only the blocks you mark with prompt_cache_breakpoint. Known values are advertised in the schema but not enforced.
      - 'implicit' | 'explicit'
      - string
    - `ttl` union: How long to keep the prompt cache, e.g. "30m". Leave unset for the provider default. Known values are advertised in the schema but not enforced.
      - '30m'
      - string
  - `parallel_tool_calls` boolean, nullable
  - `text` object, nullable: Text output configuration, e.g. {'format': {'type': 'json_schema', ...}}.
  - `include` string[], nullable: Additional output data to include, e.g. 'file_search_call.results'.
  - `background` boolean, nullable: Whether to run the model response in the background.
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'ultrafast', nullable: Processing tier, billed at that tier's rates (e.g. 'ultrafast' on openai/gpt-6.1-sol and openai/gpt-6-astra). A model that has no rates for the requested priority or ultrafast tier runs on the default tier; the response's service_tier reports the tier that ran.

## Response `200`

Successful Response

- LLMResponseObject
  - `cost` number, nullable
  - `provider` string, nullable
  - `id` string, required
  - `object` 'response'
  - `created_at` integer, required
  - `model` string, required
  - `status` string, required
  - `output` union[], required
    - union
      - ResponseOutputMessage
        - `id` string, required
        - `type` 'message', required
        - `role` 'assistant', required
        - `status` string, required
        - `content` union[], required
          - union
            - ResponseOutputText
              - …
            - ResponseOutputRefusal
              - …
            - object
      - object
  - `instructions` string, nullable
  - `previous_response_id` string, nullable
  - `usage` ResponseUsage
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `total_tokens` integer, required
    - `input_tokens_details` object, nullable
    - `output_tokens_details` object, nullable
  - `error` object, nullable
  - `metadata` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/edenai/apis/eden-ai-api-v3.md) - [All operations](https://skmtc.dev/edenai/apis/eden-ai-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/edenai/apis/eden-ai-api-v3/revisions/20ddfd49a3f4?raw)
