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

# Responses

> <ul><li>OpenAI Responses API for creating model responses.</li><li>Supports multi-turn conversations, tool calls, reasoning, and more.</li></ul>

<RequestExample>
  ```bash cURL theme={null} theme={null}
  curl --request POST \
    --url 'https://api.elkapi.com/v1/responses' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "gpt-5.5",
    "input": "The weather is great today, perfect for a walk.",
    "temperature": 1,
    "stream": false
  }'
  ```

  ```python Python theme={null} theme={null}
  import requests

  url = "https://api.elkapi.com/v1/responses"
  headers = {
      "Authorization": "Bearer <token>"
  }
  headers["Content-Type"] = "application/json"
  payload = {
      "model": "gpt-5.5",
      "input": "The weather is great today, perfect for a walk.",
      "temperature": 1,
      "stream": False
  }

  response = requests.request("POST", url, headers=headers, json=payload)
  print(response.json())
  ```

  ```javascript JavaScript theme={null} theme={null}
  const url = "https://api.elkapi.com/v1/responses";

  const headers = {
    "Authorization": "Bearer <token>"
  };
  headers["Content-Type"] = "application/json";
  const payload = {
    "model": "gpt-5.5",
    "input": "The weather is great today, perfect for a walk.",
    "temperature": 1,
    "stream": false
  };

  const response = await fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(payload)
  });

  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {
    "id": "id",
    "object": "response",
    "created_at": 1,
    "status": "completed",
    "model": "gpt-5.5",
    "output": [
      {
        "type": "type",
        "id": "id",
        "status": "status",
        "role": "user",
        "content": "Hello, please introduce yourself"
      }
    ],
    "usage": {
      "prompt_tokens": 1,
      "completion_tokens": 1,
      "total_tokens": 1,
      "prompt_tokens_details": {
        "cached_tokens": 1,
        "text_tokens": 1,
        "audio_tokens": 1,
        "image_tokens": 1
      },
      "completion_tokens_details": {
        "text_tokens": 1,
        "audio_tokens": 1,
        "reasoning_tokens": 1
      }
    }
  }
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  All endpoints require Bearer Token authentication.

  Add it to the request headers:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required default="gpt-5.5">
  Example: `gpt-5.5`
</ParamField>

<ParamField body="input" type="string or array<object>">
  Input content, either a string or an array of messages
</ParamField>

<ParamField body="instructions" type="string" />

<ParamField body="max_output_tokens" type="integer" />

<ParamField body="temperature" type="number" />

<ParamField body="top_p" type="number" />

<ParamField body="stream" type="boolean" />

<ParamField body="tools" type="array<object>" />

<ParamField body="tool_choice" type="string or object" />

<ParamField body="reasoning" type="object">
  <ParamField body="reasoning.effort" type="string">
    Allowed values: `low`, `medium`, `high`
  </ParamField>

  <ParamField body="reasoning.summary" type="string" />
</ParamField>

<ParamField body="previous_response_id" type="string" />

<ParamField body="truncation" type="string">
  Allowed values: `auto`, `disabled`
</ParamField>

## Response

<ResponseField name="id" type="string" />

<ResponseField name="object" type="string">
  Example: `response`
</ResponseField>

<ResponseField name="created_at" type="integer" />

<ResponseField name="status" type="string">
  Allowed values: `completed`, `failed`, `in_progress`, `incomplete`
</ResponseField>

<ResponseField name="model" type="string" default="gpt-5.5">
  Example: `gpt-5.5`
</ResponseField>

<ResponseField name="output" type="array<object>">
  <ResponseField name="output.type" type="string" />

  <ResponseField name="output.id" type="string" />

  <ResponseField name="output.status" type="string" />

  <ResponseField name="output.role" type="string" />

  <ResponseField name="output.content" type="array<object>">
    <ResponseField name="output.content.type" type="string" />

    <ResponseField name="output.content.text" type="string" />
  </ResponseField>
</ResponseField>

<ResponseField name="usage" type="object">
  <ResponseField name="usage.prompt_tokens" type="integer">
    Prompt token count
  </ResponseField>

  <ResponseField name="usage.completion_tokens" type="integer">
    Completion token count
  </ResponseField>

  <ResponseField name="usage.total_tokens" type="integer">
    Total token count
  </ResponseField>

  <ResponseField name="usage.prompt_tokens_details" type="object">
    <ResponseField name="usage.prompt_tokens_details.cached_tokens" type="integer" />

    <ResponseField name="usage.prompt_tokens_details.text_tokens" type="integer" />

    <ResponseField name="usage.prompt_tokens_details.audio_tokens" type="integer" />

    <ResponseField name="usage.prompt_tokens_details.image_tokens" type="integer" />
  </ResponseField>

  <ResponseField name="usage.completion_tokens_details" type="object">
    <ResponseField name="usage.completion_tokens_details.text_tokens" type="integer" />

    <ResponseField name="usage.completion_tokens_details.audio_tokens" type="integer" />

    <ResponseField name="usage.completion_tokens_details.reasoning_tokens" type="integer" />
  </ResponseField>
</ResponseField>
