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

> OpenAI 相容的 Responses API(Beta)

# 概覽

<Warning>
  **Beta API**

  此 API 目前處於測試階段(Beta),未來可能會有重大更新。在正式環境中使用時請謹慎。
</Warning>

AIHubMix 的 Responses API(Beta)提供統一介面,可存取多種相容於 OpenAI Responses API 的模型,包含 GPT、Claude、GLM、Gemini 等。

此介面同時提供進階功能,包含:

* 推理(Reasoning)
* 工具呼叫(Tool Calling)

## Base URL

```tex theme={null}
https://aihubmix.com/v1/responses
```

## 驗證

所有請求都需要透過 AIHubMix API Key 進行驗證。

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://aihubmix.com/v1/responses"

  headers = {
      "Authorization": "Bearer YOUR_AIHUBMIX_API_KEY",
      "Content-Type": "application/json"
  }

  data = {
      "model": "claude-sonnet-4-6",
      "input": "Hello, world!"
  }

  response = requests.post(url, headers=headers, json=data)

  print(response.status_code)
  print(response.json())
  ```

  ```text TypeScript theme={null}
  const response = await fetch('https://aihubmix.com/v1/responses', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_AIHUBMIX_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      model: 'o4-mini',
      input: 'Hello, world!',
    }),
  });
  ```

  ```shellscript cURL theme={null}
  curl -X POST https://aihubmix.com/v1/responses \
    -H "Authorization: Bearer YOUR_AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "o4-mini",
      "input": "Hello, world!"
    }'
  ```
</CodeGroup>

***

最後更新：2026-06-01
