SeleAI
SeleAI quickstart
SeleAI quickstart · MCP setup for Claude and Codex
One HTTPS API and one key in front of several hosted models. You never see or manage a model provider account.
Plans and spend
| Plan | SeleAI |
|---|---|
| Free | Not included |
| Starter | US$1 capped credit, small models |
| Pro | US$5 capped credit, all catalog models |
- Hard caps. Spend can never pass your prepaid credit or the lower cap you set. When it is reached the API answers
402 spend_cap_reached; nothing is charged beyond it. - Prepaid credit. You can add credit; there are no surprise bills.
- Pricing. Per model, per million input and output tokens, listed by
GET /v1/ai/models. Prices are provisional while we measure real costs. - Retries are counted. Every attempt to the model provider is metered, and a failed attempt is charged its input tokens. A request is tried at most twice.
- Catalog models only. Custom, fine-tuned or bring-your-own models are not supported.
Call the API
Request
curl https://api.seleid.dev/v1/ai/chat \
-H "Authorization: Bearer $SELEAI_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Say hello"}],"max_tokens":64}'
Response
{
"id": "…",
"model": "MODEL_ID",
"message": { "role": "assistant", "content": "Hello!" },
"usage": { "input_tokens": 12, "output_tokens": 3, "attempts": 1, "charge_micro_usd": 8 }
}
Amounts ending in micro_usd are millionths of a US dollar (1,000,000 = US$1).
JavaScript
const res = await fetch('https://api.seleid.dev/v1/ai/chat', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.SELEAI_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ model: 'MODEL_ID', messages: [{ role: 'user', content: 'Say hello' }], max_tokens: 64 }),
});
if (res.status === 402) console.error('AI spend cap reached');
const { message, usage } = await res.json();
Endpoints
| Route | Purpose |
|---|---|
POST /v1/ai/chat | model, messages (1 to 50), max_tokens (1 to the model limit, default 256) |
GET /v1/ai/models | Models your plan can call, with prices |
GET /v1/ai/usage | Your limit, spend, remaining credit, requests, attempts and tokens |
Errors
| Status | error.code | Meaning |
|---|---|---|
| 401 | unauthenticated | Missing or revoked key |
| 402 | spend_cap_reached | Credit or cap used up |
| 403 | plan_has_no_ai, model_not_in_plan | Plan does not include this |
| 400 | unknown_model, invalid_request, context_too_long | Fix the request |
| 502 | upstream_error | Model provider failed; attempts are metered |
Keep your key on your server. Never put it in a mobile app or web page.