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

# OpenAI Chat Completions API for GPT and Claude Models

> POST /gw_llm_power/v1/chat/completions — Send chat messages and receive AI responses. Supports GPT, Claude, and Gemini models via the OpenAI protocol.

The OpenAI Chat Completions API endpoint lets you send chat messages and receive AI-generated responses using the familiar OpenAI request format. You can use GPT, Claude, and Gemini models through this single endpoint, making it easy to switch between model families without changing your integration code.

**Base URL:** `http://apillm.globalaiopc.com/gw_llm_power`

**Endpoint:** `POST /v1/chat/completions`

## Authentication

Authenticate every request using the `Authorization` header with your API key:

```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## Supported Models

### GPT Models

| Standard  | `-official`        | `-hc`        | `-fd`        | `-low`        |
| --------- | ------------------ | ------------ | ------------ | ------------- |
| `gpt-5.4` | `gpt-5.4-official` | `gpt-5.4-hc` | `gpt-5.4-fd` | `gpt-5.4-low` |
| `gpt-5.5` | `gpt-5.5-official` | `gpt-5.5-hc` | `gpt-5.5-fd` | `gpt-5.5-low` |

### Claude Models

| Standard            | `-official`                  | `-hc`                  | `-fd`                  |
| ------------------- | ---------------------------- | ---------------------- | ---------------------- |
| `claude-haiku-4-5`  | `claude-haiku-4-5-official`  | `claude-haiku-4-5-hc`  | `claude-haiku-4-5-fd`  |
| `claude-opus-4-5`   | `claude-opus-4-5-official`   | `claude-opus-4-5-hc`   | `claude-opus-4-5-fd`   |
| `claude-opus-4-6`   | `claude-opus-4-6-official`   | `claude-opus-4-6-hc`   | `claude-opus-4-6-fd`   |
| `claude-opus-4-7`   | `claude-opus-4-7-official`   | `claude-opus-4-7-hc`   | `claude-opus-4-7-fd`   |
| `claude-sonnet-4-5` | `claude-sonnet-4-5-official` | `claude-sonnet-4-5-hc` | `claude-sonnet-4-5-fd` |
| `claude-sonnet-4-6` | `claude-sonnet-4-6-official` | `claude-sonnet-4-6-hc` | `claude-sonnet-4-6-fd` |

### Gemini Models

| Standard                        | `-official`                       | `-low`                       |
| ------------------------------- | --------------------------------- | ---------------------------- |
| `gemini-2.5-flash-lite`         | —                                 | —                            |
| `gemini-2.5-pro`                | `gemini-2.5-pro-official`         | `gemini-2.5-pro-low`         |
| `gemini-3-flash-preview`        | `gemini-3-flash-preview-official` | `gemini-3-flash-preview-low` |
| `gemini-3.1-flash-lite-preview` | —                                 | —                            |
| `gemini-3.1-pro-preview`        | `gemini-3.1-pro-preview-official` | `gemini-3.1-pro-preview-low` |

### Model Suffix Reference

| Suffix      | Description                                     |
| ----------- | ----------------------------------------------- |
| *(none)*    | Standard version                                |
| `-official` | Official version                                |
| `-hc`       | High-quality pool (AWS or premium account pool) |
| `-fd`       | Proxy pool / mixed account pool                 |
| `-low`      | Budget version                                  |

## Multimodal Support

| Capability     | Supported Models   |
| -------------- | ------------------ |
| Image analysis | All models         |
| Video analysis | Gemini models only |

## Request Parameters

<ParamField body="model" type="string" required>
  The name of the model to use. For example: `gpt-5.4`, `claude-opus-4-7`, or `gemini-3.1-pro-preview`.
</ParamField>

<ParamField body="messages" type="array" required>
  An array of chat message objects forming the conversation history. Each object must include a `role` and `content` field.
</ParamField>

<ParamField body="messages[].role" type="string" required>
  The role of the message author. Accepted values: `system`, `user`, or `assistant`.
</ParamField>

<ParamField body="messages[].content" type="string | array" required>
  The content of the message. Pass a plain text string for standard text input, or an OpenAI-compatible multimodal array for image or video analysis.
</ParamField>

<ParamField body="temperature" type="number">
  Controls the randomness of the model's output. Values range from `0` to `2`. Lower values produce more focused, deterministic responses; higher values produce more varied output. We recommend adjusting either `temperature` or `top_p`, but not both simultaneously.
</ParamField>

<ParamField body="top_p" type="number">
  Nucleus sampling parameter. The model considers only the tokens comprising the top `top_p` probability mass. We recommend adjusting either `top_p` or `temperature`, but not both simultaneously.
</ParamField>

<ParamField body="stream" type="boolean">
  When set to `true`, the response is returned as a stream of Server-Sent Events (SSE). The stream ends with a final `data: [DONE]` message.
</ParamField>

<ParamField body="max_completion_tokens" type="integer">
  The maximum number of tokens the model may generate in its response.
</ParamField>

<ParamField body="stop" type="string | array">
  One or more sequences at which the model will stop generating further tokens. Pass a single string or an array of up to four strings.
</ParamField>

## Response Fields

<ResponseField name="id" type="string">
  A unique identifier for the request.
</ResponseField>

<ResponseField name="object" type="string">
  The type of the returned object. Always `chat.completion` for non-streaming responses.
</ResponseField>

<ResponseField name="created" type="integer">
  The Unix timestamp (in seconds) of when the response was created.
</ResponseField>

<ResponseField name="model" type="string">
  The name of the model that was used to generate the response.
</ResponseField>

<ResponseField name="choices[].message.role" type="string">
  The role of the generated message. Always `assistant`.
</ResponseField>

<ResponseField name="choices[].message.content" type="string">
  The text content generated by the model.
</ResponseField>

<ResponseField name="choices[].finish_reason" type="string">
  The reason the model stopped generating tokens. Common values include `stop` (natural end) and `length` (token limit reached).
</ResponseField>

<ResponseField name="usage.prompt_tokens" type="integer">
  The number of tokens in the input messages.
</ResponseField>

<ResponseField name="usage.completion_tokens" type="integer">
  The number of tokens in the generated response.
</ResponseField>

<ResponseField name="usage.total_tokens" type="integer">
  The total number of tokens used in the request (prompt + completion).
</ResponseField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST http://apillm.globalaiopc.com/gw_llm_power/v1/chat/completions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.4",
      "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is artificial intelligence?"}
      ],
      "temperature": 0.7
    }'
  ```

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

  response = requests.post(
      "http://apillm.globalaiopc.com/gw_llm_power/v1/chat/completions",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "model": "gpt-5.4",
          "messages": [
              {"role": "system", "content": "You are a helpful assistant."},
              {"role": "user", "content": "What is artificial intelligence?"}
          ],
          "temperature": 0.7
      }
  )
  print(response.json()["choices"][0]["message"]["content"])
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1761635478,
  "model": "gpt-5.4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Artificial intelligence (AI) is the simulation of human intelligence processes by computer systems, including learning, reasoning, and self-correction."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 34,
    "total_tokens": 54
  }
}
```

<Note>
  To receive a streaming response, set `"stream": true` in your request body. The API will return a series of Server-Sent Events (SSE), each containing a partial response delta. The stream terminates with a final `data: [DONE]` message.
</Note>
