AISBF Logo AISBF

AI Service Broker Framework — AI Should Be Free

AISBF API docs

AISBF API Reference

Full practical API reference for AISBF: OpenAI-compatible endpoints, provider routes, rotations, autoselect, user-scoped APIs, dashboard surfaces, and MCP automation.

Authentication and route families

AISBF exposes OpenAI-compatible global routes, direct provider routes, rotation routes, autoselect routes, user-scoped routes, dashboard management routes, and MCP automation routes. API clients normally send a bearer token.

Authorization: Bearer $AISBF_API_TOKEN
Content-Type: application/json

Global

/api/v1/* and aliases. Good for default model inventory.

Provider

/api/{provider_id}/*. Use when you intentionally want one upstream.

Rotation

/api/rotations/*. Use for weighted reliability and failover.

Autoselect

/api/autoselect/*. Use for policy-driven model choice.

User-scoped

/api/user/* and /api/u/{username}/*. Preferred for hosted/multi-user apps.

MCP

/mcp and tool calls for remote agent automation.

Core OpenAI-compatible endpoints

MethodPathPurpose
GET/healthHealth check for load balancers.
GET/api/modelsList global models.
GET/api/v1/models, /v1/models, /modelsOpenAI-style model listing aliases.
GET/api/v1/models/{model_id}Fetch one model's metadata where available.
POST/api/v1/chat/completionsOpenAI-compatible chat completion.
POST/api/v1/completionsLegacy text completion.
POST/api/v1/audio/transcriptionsAudio transcription proxy.
POST/api/v1/audio/speechText-to-speech proxy.
POST/api/v1/images/generationsImage generation proxy.
POST/api/v1/embeddingsEmbedding proxy.

Minimal chat request

curl -fsS https://aisbf.example.com/api/v1/chat/completions \
  -H "Authorization: Bearer $AISBF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4.1-mini","messages":[{"role":"user","content":"Say pong"}],"max_tokens":20}'

Direct provider endpoints

MethodPathPurpose
GET/api/{provider_id}/modelsList models for one configured provider.
POST/api/{provider_id}/chat/completionsChat through a specific provider.
POST/api/{provider_id}Catch-all provider POST for provider-specific surfaces.
POST/api/audio/transcriptions, /api/audio/speech, /api/images/generations, /api/embeddingsProvider/model selected from the request body.
GET/api/proxy/{content_id}Fetch proxied content generated by upstream handlers.

Provider config shape

{
  "id": "openai-prod",
  "name": "OpenAI production",
  "endpoint": "https://api.openai.com/v1",
  "type": "openai",
  "api_key_required": true,
  "api_key": "sk-...",
  "default_rate_limit": 0.5,
  "default_max_request_tokens": 24000,
  "default_context_size": 128000,
  "default_error_cooldown": 300,
  "enable_native_caching": false,
  "enable_response_cache": null,
  "models": [{"name":"gpt-4.1-mini","context_size":128000,"max_request_tokens":24000}]
}

Rotation endpoints

MethodPathPurpose
GET/api/rotationsList global rotations.
GET/api/rotations/modelsList rotation model IDs.
POST/api/rotations/chat/completionsChat through a rotation by using the rotation's model_name.

Rotation provider entries are weighted. The higher the weight, the more often that provider/model should be selected when available. AISBF tracks failures and can disable failing routes during cooldowns.

{"model":"coding-production","messages":[{"role":"user","content":"Refactor this function"}],"stream":true}

Autoselect endpoints

MethodPathPurpose
GET/api/autoselectList global autoselect configs.
GET/api/autoselect/modelsList autoselect model IDs.
POST/api/autoselect/chat/completionsSend a request to a policy model that chooses the best candidate.

Autoselect config has model_name, description, selection_model, fallback, available_models, optional capabilities, and privacy/NSFW/semantic classification flags.

User-scoped API endpoints

MethodPathPurpose
GET/api/user/modelsList models for the authenticated token's user.
GET/api/user/providers, /api/user/rotations, /api/user/autoselectsList user-owned route inventory.
POST/api/user/chat/completionsChat using the authenticated user's route namespace.
GET/api/user/{config_type}/modelsList user provider/rotation/autoselect models for one config type.
GET/api/u/{username}/modelsList models for an explicit username namespace.
GET/api/u/{username}/providers, /api/u/{username}/rotations, /api/u/{username}/autoselectsList explicit user's configured routes where token permits.
POST/api/u/{username}/chat/completionsChat in an explicit user namespace.
GET/api/u/{username}/{config_type}/modelsList explicit user's models by config type.

Use model IDs such as user-provider/openai-prod/gpt-4.1-mini, user-rotation/coding-production, and user autoselect IDs consistently in app configs.

Dashboard and admin route map

These routes are primarily browser/dashboard surfaces, not public app APIs.

Auth/profile
/dashboard/login, /dashboard/signup, /dashboard/verify-email, /dashboard/profile, /dashboard/change-password, OAuth callbacks.
Admin config
/dashboard/providers, /dashboard/rotations, /dashboard/autoselect, /dashboard/prompts, /dashboard/condensation, /dashboard/settings, /dashboard/users.
User config
/dashboard/user/providers, /dashboard/user/rotations, /dashboard/user/autoselects, /dashboard/user/tokens.
Operations
/dashboard/analytics, /dashboard/rate-limits, /dashboard/response-cache/stats, /dashboard/response-cache/clear, /dashboard/tor/status.
Billing/tiers
/dashboard/pricing, /dashboard/subscription, /dashboard/billing, /dashboard/admin/tiers, plus /api/admin/tiers CRUD and payment settings APIs.
OAuth provider helpers
/dashboard/claude/auth/*, /dashboard/kilo/auth/*, /dashboard/codex/auth/*, /dashboard/qwen/auth/*.

MCP endpoints

MethodPathPurpose
GET/mcpSSE-style MCP endpoint.
POST/mcpHTTP JSON-RPC MCP endpoint.
GET/mcp/toolsList tools available to the token.
POST/mcp/tools/callCall an MCP tool directly.

The source config separates MCP tokens into autoselect_tokens and fullconfig_tokens. Keep full-config tokens out of normal app runtimes.

Request behavior notes

Try AISBF

AISBF is open source and also available as a hosted service. During the current testing period, hosted Pro is temporarily available as unlimited access for €2/month.