Get started
Quickstart
Go from zero to your first model response in a few minutes — create a key, then call the API directly or through the OpenAI-compatible endpoint.
1. Create an API key
Create a secret key on the API keys page and expose it to your environment. Requests authenticate with the x-api-key header.
bash
export TNSA_API_KEY="tnsa_xxxxxxxxxxxxxxxxxxxxxxxx"Keep keys secret
Never commit API keys to source control or expose them in client-side code. Use environment variables or a secrets manager.
2. Make your first request
Call /infer directly with the native API, or point an OpenAI client at https://api.tnsaai.com/v1.
curl https://api.tnsaai.com/infer \
-H "x-api-key: $TNSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "NGen-4.3-Pro",
"prompt": "Explain what an API is in one sentence.",
"stream": false
}'Example response
json
{
"id": "chatcmpl_8x2k",
"model": "NGen-4.3-Pro",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "An API is a contract that lets two programs talk to each other." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 24, "completion_tokens": 16, "total_tokens": 40 }
}What's next
- Stream responses token-by-token — see Streaming.
- Let the model call functions — see Tool calling.
- Send images for vision, or generate images with IGen.