Skip to main content

Base Configuration

SettingValue
Base URLhttps://gateway.iotex.ai
API Versionv1
Data FormatJSON
Character EncodingUTF-8
ProtocolHTTPS (TLS 1.2+)

Full Endpoint URLs

APIMethodURL
Chat CompletionsPOSThttps://gateway.iotex.ai/v1/chat/completions
List ModelsGEThttps://gateway.iotex.ai/v1/models

Request Headers

Every request must include the following headers:
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:
from openai import OpenAI

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