AI Gateway quickstart
One endpoint, available models. Create a key, send a completion, watch the cost land on your usage page.
Prerequisites
- A SetCloud account with billing set up — a saved card and the $50 starting credit deposit.
1. Create an API key
In the dashboard, open AI Gateway → API Keys and create a key. Keys start with sk-sc- and are shown once — copy it now.
export SETCLOUD_API_KEY="sk-sc-..."
2. List the models
curl https://setcloud.com/v1/models \
-H "Authorization: Bearer $SETCLOUD_API_KEY"
Use an ID returned by this request. Availability changes; examples below use nova-micro or nova-lite, which must also appear in your own catalog. Embeddings use embed-text-v2; ready custom models have custom-* IDs.
3. Send a completion
curl https://setcloud.com/v1/chat/completions \
-H "Authorization: Bearer $SETCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nova-micro",
"messages": [{ "role": "user", "content": "Say hello in five words." }]
}'
The response is OpenAI-shaped: choices[0].message.content holds the reply, usage holds the token counts you were billed for.
4. Point your existing SDK at it
The API is OpenAI-compatible. Swap the base URL and the key and choose a model returned by your catalog. Only the documented endpoints and model capabilities are supported.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.SETCLOUD_API_KEY,
baseURL: 'https://setcloud.com/v1',
});
const res = await client.chat.completions.create({
model: 'nova-lite',
messages: [{ role: 'user', content: 'Summarize this repo in one line.' }],
});
console.log(res.choices[0].message.content);
5. Watch your usage
AI Gateway → Usage shows tokens and cost per request. Usage draws down your prepaid credits — rates are on the pricing page.
Next
- API reference — full request/response schemas, tool calling, streaming, errors, rate limits.
- Embeddings — turn text into vectors with
POST /v1/embeddings. - Try models interactively in AI Gateway → Playground.
- Fine-tune a model on your own data from AI Gateway → Fine-tuning.