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

# Responses

> Call any model of any provider with the OpenAI Responses format.

The body is an [OpenAI Responses request](https://platform.openai.com/docs/api-reference/responses/create), whatever the provider: the gateway translates it for Anthropic, Google, Bedrock, Mistral and the others, and answers in OpenAI's format. Point any OpenAI client at `https://gateway.weflayr.com/v1` with a [Gateway API key](/product/api-keys).

## OpenAI fields

The gateway reads `model`, `input`, `instructions`, `tools`, `tool_choice`, `text`, `reasoning`, `max_output_tokens`, `temperature`, `top_p`, `parallel_tool_calls`, `service_tier`, `user`, `metadata`, `stream`, `stream_options`, `top_logprobs`, `include`, `store`, `prompt_cache_key`, `prompt_cache_retention`, `safety_identifier`, `max_tool_calls`, `truncation`, `previous_response_id`, `conversation`, `background` and `prompt`.

<Note>
  `previous_response_id`, `conversation`, `store: true`, `prompt`, `metadata`, `text.verbosity` and most `include` entries work with OpenAI models only. `background: true`, `n`, and built-in tools other than `web_search` are refused for every model.
</Note>

## Weflayr fields

The gateway reads these fields on top of the OpenAI ones and never sends them to the provider. With the OpenAI SDK, pass them in `extra_body` (Python) or as extra keys of the request object (Node.js).

<ParamField body="model" type="string" required>
  A model name, as listed in the model picker of a [benchmark](/product/model-benchmarks) (e.g. `claude-opus-5-5`, `gpt-5.6`), or a [routing strategy](/product/routing-strategies) id: `strategy/<id>` for its latest version, `strategy/<id>:<version>` to pin one.
</ParamField>

<ParamField body="provider" type="string">
  Serve the model from this provider only: `alibaba`, `anthropic`, `azure`, `bedrock`, `google`, `mistral`, `openai`, `spacexai` or `vertex`. Omit to let Weflayr pick one. Not allowed with a routing strategy.
</ParamField>

<ParamField body="region" type="string">
  Serve the model from this region only: `GLOBAL`, `US`, `EU`, or a provider's own region (e.g. `eu-west-1` on Bedrock). Not allowed with a routing strategy.
</ParamField>

<ParamField body="self_heal" type="&#x22;on_with_warnings&#x22; | &#x22;on&#x22; | &#x22;off&#x22;" default="&#x22;on_with_warnings&#x22;">
  What to do with a parameter the model does not take (e.g. `temperature` on a reasoning model): `on_with_warnings` removes it and lists the change in `weflayr_warnings`, `on` removes it silently, `off` sends the request unchanged.
</ParamField>

<ParamField body="drop_inputs_if_unsupported" type="list[string]">
  Parameters to remove when the model does not take them, even with `self_heal: "off"`: any of `service_tier`, `temperature`, `tool_choice`, `reasoning`, `cache_breakpoints`, `parallel_tool_calls`.
</ParamField>

<ParamField body="provider_options" type="object">
  Raw provider fields merged into the request sent to the provider, keyed by `common` (every provider), an API family (e.g. `anthropic_messages`, `gemini_generate_content`) or a provider (e.g. `openai`).
</ParamField>

<ParamField body="weflayr" type="object">
  What the call is for, shown on your dashboards.

  <Expandable title="properties">
    <ParamField body="customer_name" type="string">
      The customer the call is made for. It joins your AI cost to your [revenue](/product/cost-and-revenue), and selects the customer [overrides](/product/routing-strategies) of a routing strategy. Defaults to the OpenAI `user` field.
    </ParamField>

    <ParamField body="call_name" type="string">
      The name of this LLM call inside its feature, e.g. `summarize_ticket`. A [benchmark](/product/model-benchmarks) is set up per call name.
    </ParamField>

    <ParamField body="tags" type="{string: string}">
      Your own dimensions to filter on, e.g. `{"environment": "production"}`.
    </ParamField>

    <ParamField body="store_message_content" type="boolean" default="true">
      Keep the prompt and the answer. Set `false` to keep only tokens, cost and latency. Benchmarks need the content.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField header="x-weflayr-metadata" type="JSON object">
  The feature the call belongs to, as `{"feature_name": "support-chat"}`. It also takes `feature_run_uuid` (32 hex characters, to group the calls of one feature run), `customer_name`, `call_name` and `tags`; the body's `weflayr` values win over the header's. The [SDKs](/sdks/python#send-metadata-to-the-gateway) set this header for you.
</ParamField>

## Response

An OpenAI Response object. When `self_heal` changed the request, the response also carries `weflayr_warnings`, a list of the changes.

With `"stream": true`, the gateway answers with OpenAI's Responses events, from `response.created` to `response.completed`. Warnings then come first, in a `weflayr.warnings` event.

## Errors

See [Errors](/api/introduction#errors).

<RequestExample>
  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(base_url="https://gateway.weflayr.com/v1", api_key="<WEFLAYR_API_KEY>")

  response = client.responses.create(
      model="claude-opus-5-5",
      instructions="Answer in one sentence.",
      input="Hello",
      max_output_tokens=256,
      extra_headers={"x-weflayr-metadata": '{"feature_name": "support-chat"}'},
      extra_body={"weflayr": {"customer_name": "acme", "call_name": "answer_question"}},
  )
  ```

  ```js Node.js theme={null}
  const OpenAI = require('openai');

  const client = new OpenAI({ baseURL: 'https://gateway.weflayr.com/v1', apiKey: '<WEFLAYR_API_KEY>' });

  const response = await client.responses.create(
    {
      model: 'claude-opus-5-5',
      instructions: 'Answer in one sentence.',
      input: 'Hello',
      max_output_tokens: 256,
      weflayr: { customer_name: 'acme', call_name: 'answer_question' },
    },
    { headers: { 'x-weflayr-metadata': JSON.stringify({ feature_name: 'support-chat' }) } },
  );
  ```

  ```bash cURL theme={null}
  curl https://gateway.weflayr.com/v1/responses \
    -H "Authorization: Bearer $WEFLAYR_API_KEY" \
    -H "Content-Type: application/json" \
    -H 'x-weflayr-metadata: {"feature_name": "support-chat"}' \
    -d '{
      "model": "claude-opus-5-5",
      "instructions": "Answer in one sentence.",
      "input": "Hello",
      "max_output_tokens": 256,
      "weflayr": {"customer_name": "acme", "call_name": "answer_question"}
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "resp_6b1f0d2c8e4a4f7b9c3d5e1a2b4c6d8e",
    "object": "response",
    "created_at": 1792051200,
    "status": "completed",
    "model": "claude-opus-5-5",
    "output": [
      {
        "type": "message",
        "role": "assistant",
        "content": [{"type": "output_text", "text": "Hello! How can I help you today?", "annotations": []}]
      }
    ],
    "usage": {"input_tokens": 14, "output_tokens": 12, "total_tokens": 26}
  }
  ```
</ResponseExample>


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