Get Started in 3 Steps
Step 1: Get Your API Key
Obtain your exclusive API key in the format: sk-xxxxxxxxxx on https://ai.machinefi.com/console/token
Step 2: Make Your First API Call
Simplest method using curl:
curl https://ai.machinefi.com/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 100
}'Python version:
import requests
response = requests.post(
'https://ai.machinefi.com/v1/chat/completions',
headers={'Authorization': 'Bearer your-api-key'},
json={
'model': 'gpt-3.5-turbo',
'messages': [{'role': 'user', 'content': 'Hello'}]
}
)
print(response.json()['choices'][0]['message']['content'])Step 3: View the Response
A successful call will return the AI's response:
🎉 Congratulations! You've successfully integrated IoTeX AI Gateway

