1
Get Your API Key
Visit the Gateway Console to generate your API key in the format
sk-xxxxxxxxxx.2
Make Your First API Call
3
View the Response
A successful call returns the AI’s response in standard OpenAI format:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Set up your first API call in minutes
Get Your API Key
sk-xxxxxxxxxx.Make Your First API Call
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"}],
"max_tokens": 100
}'
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://gateway.iotex.ai/v1"
)
response = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=100
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-api-key",
baseURL: "https://gateway.iotex.ai/v1"
});
const response = await client.chat.completions.create({
model: "gemini-2.5-flash",
messages: [{ role: "user", content: "Hello" }],
max_tokens: 100
});
console.log(response.choices[0].message.content);
View the Response
{
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! I'm an AI assistant, and I'm happy to help you. What can I do for you today?"
}
}
]
}