SeleID

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

PlanSeleAI
FreeNot included
StarterUS$1 capped credit, small models
ProUS$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

RoutePurpose
POST /v1/ai/chatmodel, messages (1 to 50), max_tokens (1 to the model limit, default 256)
GET /v1/ai/modelsModels your plan can call, with prices
GET /v1/ai/usageYour limit, spend, remaining credit, requests, attempts and tokens

Errors

Statuserror.codeMeaning
401unauthenticatedMissing or revoked key
402spend_cap_reachedCredit or cap used up
403plan_has_no_ai, model_not_in_planPlan does not include this
400unknown_model, invalid_request, context_too_longFix the request
502upstream_errorModel provider failed; attempts are metered

Keep your key on your server. Never put it in a mobile app or web page.

Last updated 2026-11-12Suggest an editReport a problem with this page