> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atlaso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a response

> Send an OpenAI Responses request through Atlaso, with memory added.

OpenAI models get the request as sent; other models get it translated. See [Responses API](https://docs.atlaso.ai/gateway/responses-api.md) for what each model accepts.


## OpenAPI

````yaml api-reference/openapi.json POST /responses
openapi: 3.1.0
info:
  title: Atlaso Gateway API
  version: 1.0.0
  description: An OpenAI-compatible API that calls your own provider keys and adds memory.
servers:
  - url: https://api.atlaso.ai/v1
security:
  - AtlasoKey: []
paths:
  /responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        Sends an OpenAI Responses request. OpenAI models get it as sent; other
        models get it translated to their own API. Atlaso does not store
        responses. Built-in tools that carry a provider fee (such as
        `web_search`) are refused with 400 `unsupported_parameter` when the key,
        account or app user has a spending limit; without a limit the call goes
        through and Atlaso's cost covers tokens only. With `stream: true` the
        reply is Server-Sent Events in the Responses event shape. The `atlaso`
        object rides on the final event: in `response.atlaso` of
        `response.completed`, `response.incomplete` or `response.failed`, or as
        `atlaso` on an `error` event. Atlaso adds no event of its own, except an
        `error` event when the provider's stream breaks off. A streamed reply
        has no `x-atlaso-cost-usd` or `x-atlaso-cache` header.
      operationId: createResponse
      parameters:
        - name: x-atlaso-memory
          in: header
          required: false
          description: >-
            Lowers memory for this one call. `off`: no recall and no learning,
            and the reply's `x-atlaso-memory` header says `status=off` with
            `reason=request_off`. `use`: recall as usual, but nothing from this
            call is learned. Letter case and spaces around the value are
            ignored; any other value is ignored too. It never turns memory or
            learning on for a key whose settings are lower.
          schema:
            type: string
            enum:
              - 'off'
              - use
        - name: x-atlaso-user
          in: header
          required: false
          description: >-
            Your app user's id, set by your server. A key set to memory for each
            user of your app reads the user only from this header. 1 to 256
            printable characters, not only spaces, with no API key or token in
            it. Send it once. Used exactly as sent.
          schema:
            type: string
            minLength: 1
            maxLength: 256
          example: demo-user-42
        - name: x-atlaso-session-id
          in: header
          required: false
          description: >-
            Your own id for a group of related calls (a chat session). Only
            printable ASCII is kept: other characters are removed and a longer
            value is cut to 128 characters. Ignored when the call comes from
            Claude Code or Codex through the Gateway (coming soon), which will
            send their own.
          schema:
            type: string
          example: session-7
        - name: x-atlaso-client
          in: header
          required: false
          description: >-
            The name of your app or tool, shown with the call in Activity. Only
            printable ASCII is kept: other characters are removed and a longer
            value is cut to 64 characters.
          schema:
            type: string
          example: support-bot
        - name: x-atlaso-tags
          in: header
          required: false
          description: >-
            Your own labels for this call, as comma-separated `key=value` pairs.
            At most 10 tags per call (header and body together). A key is
            lowercase letters, digits, `_` and `-`, at most 32 characters. A
            value is printable ASCII, 1 to 64 characters. A tag that breaks a
            rule is dropped and named in `x-atlaso-tags-dropped`; the call still
            goes ahead. A header over 2048 characters is not read at all: none
            of its tags is used, and `x-atlaso-tags-dropped` names it as
            `x-atlaso-tags too_long`. See [Tags](/gateway/tags).
          schema:
            type: string
          example: feature=chat,env=prod
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
              additionalProperties: true
              description: >-
                The OpenAI Responses request. OpenAI models get the body as
                sent; other models get it translated, and a field the
                translation does not know is refused with 400. At most 32 MiB.
              properties:
                model:
                  type: string
                  description: An exact model id from `GET /models`.
                  example: openai/gpt-5.4-mini
                input:
                  description: A string, or an array of Responses input items.
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                        additionalProperties: true
                instructions:
                  type: string
                  description: System instructions.
                stream:
                  type: boolean
                  description: Send `true` for Server-Sent Events.
                tools:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                tool_choice:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                parallel_tool_calls:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                max_output_tokens:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                temperature:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                top_p:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                reasoning:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                text:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                service_tier:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                prompt_cache_options:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                prompt_cache_retention:
                  description: >-
                    Passed to the provider, or mapped to the provider's own
                    field. A provider that cannot take it refuses the call with
                    400.
                user:
                  description: >-
                    Never fails a call. OpenAI and OpenAI-compatible hosts get
                    it as sent. Where Atlaso knows the provider does not take
                    it, it is left out of the provider request and named in
                    `x-atlaso-ignored-params`. On a key that keeps your own
                    memory, Atlaso also reads it to label cost by app user
                    (`x-atlaso-user` first, then `safety_identifier`, then
                    `user`). On a key with memory for each user of your app, a
                    value that differs from `x-atlaso-user` is refused with 400
                    `user_id_conflict`. On Google models the value is sent as a
                    label, which allows at most 63 characters of lowercase
                    letters, digits, `_` or `-`. A value those rules do not
                    allow is left out and named in `x-atlaso-ignored-params`; it
                    is never rewritten. When `user` and `safety_identifier` are
                    both sent with different values, `safety_identifier` is the
                    label (or `user`, when only its value is allowed) and the
                    other is left out and named.
                safety_identifier:
                  description: >-
                    Never fails a call. OpenAI and OpenAI-compatible hosts get
                    it as sent. Where Atlaso knows the provider does not take
                    it, it is left out of the provider request and named in
                    `x-atlaso-ignored-params`. On a key that keeps your own
                    memory, Atlaso also reads it to label cost by app user
                    (`x-atlaso-user` first, then `safety_identifier`, then
                    `user`). On a key with memory for each user of your app, a
                    value that differs from `x-atlaso-user` is refused with 400
                    `user_id_conflict`. On Google models the value is sent as a
                    label, which allows at most 63 characters of lowercase
                    letters, digits, `_` or `-`. A value those rules do not
                    allow is left out and named in `x-atlaso-ignored-params`; it
                    is never rewritten. When `user` and `safety_identifier` are
                    both sent with different values, `safety_identifier` is the
                    label (or `user`, when only its value is allowed) and the
                    other is left out and named.
                metadata:
                  description: >-
                    Never fails a call. OpenAI and OpenAI-compatible hosts get
                    it as sent. Where Atlaso knows the provider does not take
                    it, it is left out of the provider request and named in
                    `x-atlaso-ignored-params`.
                store:
                  type: boolean
                  description: >-
                    On models other than OpenAI, `true` is refused with 400;
                    Atlaso does not store conversations.
                previous_response_id:
                  type: string
                  description: OpenAI models only. Refused with 400 on other models.
                conversation:
                  description: OpenAI models only. Refused with 400 on other models.
                background:
                  type: boolean
                  description: '`true` is refused with 400 on OpenAI models.'
                provider:
                  type: object
                  description: >-
                    Atlaso's routing choice for a model several hosts serve.
                    Taken out of the body before the provider call. Any other
                    sub-field is refused with 400.
                  properties:
                    order:
                      type: array
                      maxItems: 16
                      items:
                        type: string
                      description: Hosts to try first, in this order.
                    only:
                      type: array
                      maxItems: 16
                      items:
                        type: string
                      description: Use only these hosts.
                    ignore:
                      type: array
                      maxItems: 16
                      items:
                        type: string
                      description: Never use these hosts.
                    allow_fallbacks:
                      type: boolean
                      default: true
                      description: >-
                        Whether the call may switch to the next host in routing
                        order (`order`, after `only` and `ignore`) when a host
                        fails before any answer has been sent. False keeps the
                        call on the first host.
                  additionalProperties: false
                  example:
                    order:
                      - together
                      - fireworks
                atlaso:
                  type: object
                  description: >-
                    Atlaso's own body field, always taken out before the
                    provider call. Its `tags` object holds your labels for the
                    call; a body tag replaces a header tag with the same key.
                  properties:
                    tags:
                      type: object
                      additionalProperties:
                        type: string
                      description: Key to value, with the same rules as `x-atlaso-tags`.
                  example:
                    tags:
                      feature: chat
              example:
                model: openai/gpt-5.4-mini
                input: What do I like to drink?
      responses:
        '200':
          description: >-
            The response in the OpenAI Responses shape. Atlaso adds reply
            headers.
          headers:
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-ignored-params:
              $ref: '#/components/headers/IgnoredParams'
            x-atlaso-tags-dropped:
              $ref: '#/components/headers/TagsDropped'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  The provider's reply in the OpenAI shape, unchanged for OpenAI
                  models.
              example:
                id: resp_123
                object: response
                status: completed
                model: gpt-5.4-mini
                output:
                  - type: message
                    role: assistant
                    content:
                      - type: output_text
                        text: You like oat-milk lattes.
            text/event-stream:
              schema:
                type: string
                description: >-
                  With `stream: true` the reply is Server-Sent Events in the
                  Responses event shape. The `atlaso` object rides on the final
                  event: in `response.atlaso` of `response.completed`,
                  `response.incomplete` or `response.failed`, or as `atlaso` on
                  an `error` event. Atlaso adds no event of its own, except an
                  `error` event when the provider's stream breaks off. A
                  streamed reply has no `x-atlaso-cost-usd` or `x-atlaso-cache`
                  header. The `atlaso` object is described under the Atlaso
                  schema.
        '400':
          description: >-
            The request was refused before any provider call, or the provider
            refused it as invalid. Codes: `invalid_body`,
            `unsupported_parameter`, `invalid_request_error`,
            `model_kind_not_supported`, `cache_retention_not_available`,
            `provider_key_missing`, `provider_key_disabled`,
            `provider_endpoint_missing`, `provider_workspace_not_found`,
            `provider_workspace_required`, `provider_invalid_request`,
            `provider_bad_request`, `bedrock_inference_profile_required`,
            `azure_content_filter`, `user_id_required`, `user_id_not_accepted`,
            `user_id_conflict`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Parameter 'logit_bias' is not supported by this Anthropic
                    model. Remove 'logit_bias' and retry.
                  type: invalid_request_error
                  param: null
                  code: unsupported_parameter
                  doc_url: https://docs.atlaso.ai/gateway/errors#unsupported_parameter
        '401':
          description: >-
            The Atlaso key is missing, invalid or revoked, or the provider
            rejected your saved key. Codes: `invalid_api_key`,
            `provider_key_rejected`, `azure_claude_key_refused`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Your Atlaso API key is missing, invalid or revoked. Set
                    Authorization: Bearer to an active key from the API keys
                    page.
                  type: authentication_error
                  param: null
                  code: invalid_api_key
                  doc_url: https://docs.atlaso.ai/gateway/errors#invalid_api_key
        '402':
          description: >-
            The provider refused the call for a billing reason. Codes:
            `provider_billing_error`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    OpenAI refused the call for a billing reason on your saved
                    key. Check your OpenAI plan and credit.
                  type: billing_error
                  param: null
                  code: provider_billing_error
                  doc_url: https://docs.atlaso.ai/gateway/errors#provider_billing_error
        '403':
          description: >-
            The Atlaso API is not enabled for the account, or the provider
            denied access. Codes: `gateway_not_enabled`,
            `provider_permission_denied`, `third_party_data_sharing_blocked`,
            `groq_org_model_blocked`, `groq_project_model_blocked`,
            `qwen_model_access_denied`, `qwen_workspace_access_denied`,
            `qwen_billing_required`, `qwen_model_unavailable`,
            `bedrock_account_not_enabled`, `bedrock_api_keys_blocked`,
            `bedrock_access_denied`, `bedrock_payment_method_required`,
            `bedrock_model_access_required`, `azure_policy_blocked`,
            `azure_quota_required`, `coreweave_inference_disabled`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    The Atlaso API is not enabled for this account yet. No model
                    call was made.
                  type: permission_error
                  param: null
                  code: gateway_not_enabled
                  doc_url: https://docs.atlaso.ai/gateway/errors#gateway_not_enabled
        '404':
          description: >-
            The model is not available through Atlaso, or Microsoft Foundry has
            no deployment of it in your resource. Codes: `model_not_available`,
            `azure_deployment_required`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    This model is not available through Atlaso. Choose an exact
                    id from GET /v1/models.
                  type: invalid_request_error
                  param: null
                  code: model_not_available
                  doc_url: https://docs.atlaso.ai/gateway/errors#model_not_available
        '405':
          description: >-
            The route exists but not with this method. Codes:
            `method_not_allowed`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Method not allowed.
                  type: invalid_request_error
                  param: null
                  code: method_not_allowed
                  doc_url: https://docs.atlaso.ai/gateway/errors#method_not_allowed
        '410':
          description: >-
            Microsoft retired the model, so Microsoft Foundry no longer answers
            calls to it. Codes: `azure_model_retired`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Microsoft retired this model, so Microsoft Foundry no longer
                    answers calls to it. Choose a newer model. Microsoft's model
                    retirement schedule names its replacement.
                  type: invalid_request_error
                  param: null
                  code: azure_model_retired
                  doc_url: https://docs.atlaso.ai/gateway/errors#azure_model_retired
        '413':
          description: 'The body is over 32 MiB. Codes: `request_too_large`.'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    The request body is too large. Send at most 32 MiB, or
                    shorten the messages.
                  type: invalid_request_error
                  param: null
                  code: request_too_large
                  doc_url: https://docs.atlaso.ai/gateway/errors#request_too_large
        '429':
          description: >-
            A limit was reached, at Atlaso or at the provider. Codes:
            `rate_limited`, `account_rate_limited`, `key_daily_limit`,
            `user_daily_limit_reached`, `monthly_budget_reached`,
            `repeated_request_stopped`, `agent_loop_stopped`,
            `provider_rate_limit`, `insufficient_quota`, `provider_spend_limit`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Too many requests on this Atlaso key. Retry after the
                    indicated delay; no model call was made.
                  type: rate_limit_error
                  param: null
                  code: rate_limited
                  doc_url: https://docs.atlaso.ai/gateway/errors#rate_limited
        '500':
          description: 'Atlaso hit an internal error. Codes: `internal_error`.'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Atlaso hit an internal error. Retry; if it repeats, contact
                    support with the x-request-id.
                  type: api_error
                  param: null
                  code: internal_error
                  doc_url: https://docs.atlaso.ai/gateway/errors#internal_error
        '502':
          description: >-
            The provider failed or gave an unusable reply. Codes:
            `provider_unavailable`, `provider_invalid_response`,
            `provider_reply_failed`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    OpenAI is unavailable or returned a server error. The
                    request may have reached OpenAI; check your OpenAI usage
                    before retrying. Atlaso did not retry or switch providers.
                  type: api_error
                  param: null
                  code: provider_unavailable
                  doc_url: https://docs.atlaso.ai/gateway/errors#provider_unavailable
        '503':
          description: >-
            Atlaso could not check the key or reach memory, or the provider is
            busy. Codes: `auth_unavailable`, `memory_unavailable`,
            `provider_busy`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            x-should-retry:
              $ref: '#/components/headers/ShouldRetry'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Atlaso could not check your API key right now. Retry
                    shortly; no model call was made.
                  type: api_error
                  param: null
                  code: auth_unavailable
                  doc_url: https://docs.atlaso.ai/gateway/errors#auth_unavailable
        '504':
          description: 'The provider did not answer in time. Codes: `provider_timeout`.'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-atlaso-call-id:
              $ref: '#/components/headers/CallId'
            x-atlaso-provider:
              $ref: '#/components/headers/Provider'
            x-atlaso-model:
              $ref: '#/components/headers/Model'
            x-atlaso-reason:
              $ref: '#/components/headers/Reason'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            x-atlaso-cost-usd:
              $ref: '#/components/headers/CostUsd'
            x-atlaso-cache:
              $ref: '#/components/headers/Cache'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    OpenAI did not answer in time. The request may have reached
                    OpenAI; check your OpenAI usage before retrying. Atlaso did
                    not retry or switch providers.
                  type: api_error
                  param: null
                  code: provider_timeout
                  doc_url: https://docs.atlaso.ai/gateway/errors#provider_timeout
components:
  headers:
    CallId:
      description: The call's id.
      schema:
        type: string
      example: 01JZ8X4Q2M7N3P5R6S7T8V9W0X
    Provider:
      description: >-
        Host name of the provider that answered, or `none` when no provider
        answered.
      schema:
        type: string
      example: api.openai.com
    Model:
      description: Catalog id of the model that answered, or `none`.
      schema:
        type: string
      example: openai/gpt-5.4-mini
    CostUsd:
      description: >-
        List-price cost in US dollars, six decimals, or `unknown`. A call
        refused before it reached a provider carries `0.000000`. Not sent on a
        stream, except `0.000000` for a free model.
      schema:
        type: string
      example: '0.000412'
    Cache:
      description: >-
        Prompt cache tokens: `read=N; write=N`, `unknown` for a count not known.
        Not sent on a stream.
      schema:
        type: string
      example: read=0; write=0
    Reason:
      description: >-
        Present when the call did not end normally, for example an error code or
        `provider_refusal`.
      schema:
        type: string
      example: provider_refusal
    MemoryReceipt:
      description: >-
        What memory did: `status=...; ids=...; ms=...; reason=...; added=...;
        action=...`. `status` is `used`, `none`, `skipped`, `off` or `bypass`.
        With `x-atlaso-memory: off` it reads `status=off` and
        `reason=request_off`; a key whose memory is off gives
        `reason=key_mode_off`. Routes that do not use memory say
        `status=bypass`.
      schema:
        type: string
      example: status=none; ids=; ms=38; reason=no_match; added=0; action=none
    PaidBy:
      description: 'Always `own_key`: the provider bills your own key.'
      schema:
        type: string
        enum:
          - own_key
      example: own_key
    RequestId:
      description: Atlaso's id for this request. Quote it to support.
      schema:
        type: string
      example: req_4f1c2e9a7b6d4c3e8a1f0b2d
    IgnoredParams:
      description: >-
        Settings you sent that the provider ignores or that were left out for
        it, comma separated. Only when there are any.
      schema:
        type: string
      example: temperature,top_p
    TagsDropped:
      description: >-
        Tags that were dropped and why, separated by `; `. Values are never
        echoed. Only when a tag was dropped.
      schema:
        type: string
      example: 'customer secret; #3 invalid_key'
    ShouldRetry:
      description: '`false` when retrying soon cannot help. The OpenAI SDKs read it.'
      schema:
        type: string
        enum:
          - 'false'
      example: 'false'
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: string
      example: '2'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - param
            - code
            - doc_url
          properties:
            message:
              type: string
              description: What happened and what to do.
            type:
              type: string
              description: Error type, as OpenAI uses it.
              example: invalid_request_error
            param:
              type:
                - string
                - 'null'
              description: The field or header at fault, if any.
            code:
              type: string
              description: A stable code. A provider's own code may appear too.
            doc_url:
              type: string
              format: uri
              description: Where this code is explained on the Errors page.
  securitySchemes:
    AtlasoKey:
      type: http
      scheme: bearer
      bearerFormat: sk-at-...
      description: >-
        Your Atlaso key in `Authorization: Bearer sk-at-...`. Send one
        Authorization header. A request that also sends `x-atlaso-key` is
        refused with 401.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.