Quickstart
On this page
Call a model with a project API key through the SDK you already use, then find the request under "Request logs" in the Console. This page uses the OpenAI format; for the Anthropic and Gemini formats, see Anthropic SDK and Google GenAI SDK.
- An ATP Token account: sign up free
- At least USD 5 in credits (500 credits). Without credits, requests return
402. - Python or Node.js installed, or just curl in a terminal.
Create an account and add credits#
Sign in to the Console. On your first sign-in you name your organization. Then open "Billing" and choose "Top up". The minimum is USD 5 (500 credits), and credits do not expire. If you use a team organization, top-ups go to your personal wallet first; then go to "Resources" and allocate credits to the workspace that will use them. See Top-ups and wallets.
Create an API key#
Open "API Keys" in the Console and choose "Create API key". The wizard lets you pick an existing workspace and project, or create them if your role allows it; then it sets the models the project can call and creates the key. Select at least one model — this key can call only those models.
The key starts with atp-, and its full value is shown only once. Copy it right away.
Install the SDK and set your key#
export ATP_API_KEY="atp-your-key"The Gateway base URL is https://api.atptoken.ai/v1 (OpenAI format). For the headers that can carry your key, see Authentication.
List the models your key can use#
curl https://api.atptoken.ai/v1/models \
-H "Authorization: Bearer $ATP_API_KEY"Pick a model ID from the list for the next step. If the list is empty, the project has no models enabled yet: open "Resources" in the Console and add models to the project.
Send your first request#
Replace MODEL_ID with the model ID you picked in the previous step.
curl https://api.atptoken.ai/v1/chat/completions \
-H "Authorization: Bearer $ATP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"messages": [{"role": "user", "content": "hi"}]
}'A successful call returns an OpenAI-format response: choices[0].message.content is the model's reply, and usage holds this call's input/output tokens.
{
"object": "chat.completion",
"model": "MODEL_ID",
"choices": [
{
"message": { "role": "assistant", "content": "Hi! How can I help?" },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 9,
"total_tokens": 17
}
}For other status codes, see Error codes.
Find the request in the Console#
Open "Overview" in the Console and choose "View all" under "Recent requests", or go straight to Request logs. Your request is at the top, with its model, status and input/output tokens; the credits it used count toward "Usage".