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

# 代理提供商請求

> 使用您的 ARouter API key 透過 ARouter 代理原生提供商請求。

ARouter 的提供商代理將請求直接轉發到受支援提供商的原生 API，同時為您處理提供商認證。

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.arouter.ai/openai/v1/chat/completions \
    -H "Authorization: Bearer lr_live_xxxx" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.4",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```

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

  resp = requests.post(
      "https://api.arouter.ai/anthropic/v1/messages",
      headers={
          "Authorization": "Bearer lr_live_xxxx",
          "Content-Type": "application/json",
      },
      json={
          "model": "claude-sonnet-4.6",
          "max_tokens": 1024,
          "messages": [{"role": "user", "content": "Hello!"}],
      },
  )
  print(resp.json())
  ```

  ```typescript Node.js theme={null}
  const response = await fetch("https://api.arouter.ai/google/v1beta/models/gemini-2.5-flash:generateContent", {
    method: "POST",
    headers: {
      Authorization: "Bearer lr_live_xxxx",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      contents: [
        { role: "user", parts: [{ text: "Hello!" }] }
      ],
    }),
  });

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

## 路徑參數

| 參數         | 描述                                                         |
| ---------- | ---------------------------------------------------------- |
| `provider` | 提供商識別碼，如 `openai`、`anthropic`、`google`、`deepseek` 或 `groq` |
| `path`     | 提供商前綴後要轉發的原生 API 路徑                                        |

## 說明

* 請求和回應以提供商的原生格式傳遞。
* ARouter 自動注入提供商憑證。您只需發送您的 ARouter API key。
* 使用量仍計入您的 ARouter 帳戶。
* 當您需要規範化 ARouter 請求結構中未涵蓋的提供商原生功能時，請使用此端點。

包含提供商特定範例的更完整指南，請參閱[提供商代理](/zh-Hant/guides/provider-proxy)。
