Skip to main content
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

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
  }'
3

View the Response

A successful call returns the AI’s response in standard OpenAI format:
{
  "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?"
      }
    }
  ]
}
Congratulations! You’ve successfully integrated IoTeX AI Gateway.