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

# Basic Information

> API endpoint, version, and data format details

## Base Configuration

| Setting                | Value                      |
| ---------------------- | -------------------------- |
| **Base URL**           | `https://gateway.iotex.ai` |
| **API Version**        | `v1`                       |
| **Data Format**        | JSON                       |
| **Character Encoding** | UTF-8                      |
| **Protocol**           | HTTPS (TLS 1.2+)           |

## Full Endpoint URLs

| API              | Method | URL                                            |
| ---------------- | ------ | ---------------------------------------------- |
| Chat Completions | `POST` | `https://gateway.iotex.ai/v1/chat/completions` |
| List Models      | `GET`  | `https://gateway.iotex.ai/v1/models`           |

## Request Headers

Every request must include the following headers:

```http theme={null}
Authorization: Bearer your-api-key
Content-Type: application/json
```

## OpenAI SDK Configuration

Since IoTeX AI Gateway is OpenAI-compatible, you can use the official OpenAI SDK by pointing it to the gateway:

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

  client = OpenAI(
      api_key="your-api-key",
      base_url="https://gateway.iotex.ai/v1"
  )
  ```

  ```javascript JavaScript theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
      apiKey: "your-api-key",
      baseURL: "https://gateway.iotex.ai/v1"
  });
  ```

  ```bash cURL theme={null}
  curl https://gateway.iotex.ai/v1/chat/completions \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{"model": "gemini-2.5-flash", "messages": [{"role": "user", "content": "Hello"}]}'
  ```
</CodeGroup>
