API Documentation

OpenAI-compatible API. One key, every major AI model. Drop-in replacement for OpenAI, Anthropic, Google, and more.

โšก Quick Start

Botstrapp.ai is fully OpenAI-compatible. Use any OpenAI SDK โ€” just change the base URL and API key.

Python

python
from openai import OpenAI

client = OpenAI(
    base_url="https://botstrapp.ai/v1",
    api_key="bst_your_api_key_here",
)

response = client.chat.completions.create(
    model="gemini/gemini-2.5-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

JavaScript / Node.js

javascript
import OpenAI from 'openai';

const client = new OpenAI({
    baseURL: 'https://botstrapp.ai/v1',
    apiKey: 'bst_your_api_key_here',
});

const response = await client.chat.completions.create({
    model: 'gpt-4o',
    messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);

cURL

bash
curl https://botstrapp.ai/v1/chat/completions \
  -H "Authorization: Bearer bst_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
๐Ÿ’ก Getting an API Key Create a free account at botstrapp.ai/chat โ€” you'll receive 1,000 attach ($1.00 service-value) instantly. Your API key is generated automatically and available in your account settings.

๐Ÿค– Available Models

Access models from 10+ providers through a single API. Use GET /v1/catalog for the live list.

TierTypical estimate per messageExample Models
Budget~9 attach (~$0.009)Gemini Flash, GPT-5 Mini, Llama 3.3, Claude Haiku, Qwen 3 30B, DeepSeek V3, Phi-4
Standard~19 attach (~$0.019)GPT-5, Claude Sonnet 4.6, Gemini Pro, Grok 3, Qwen 3 235B, Moonshot Kimi K2
Premium~29โ€“49 attach (~$0.029โ€“0.049)Claude Opus 4.6, GPT-5 Turbo, DeepSeek R1, Grok 3 Reasoning

How billing works

These are estimates, not fixed prices. When you send a message, the estimate is held from your balance. After the response completes, the charge settles to the actual provider cost × 1.35 platform markup (the rate is public โ€” see the X-Botstrapp-Markup-Rate response header). Minimum charge is 5 attach ($0.005) per message. Short messages settle below the estimate; long messages on premium models can settle above it โ€” the estimate is a typical midpoint, not a cap. Failed requests and broken streams are fully refunded automatically.

๐Ÿ“ก Live Model List Fetch available models programmatically: GET /v1/models or GET /v1/catalog for detailed info including providers and availability status. The catalog is the single source of truth โ€” it powers the Chat UI and Pricing page dynamically.

๐ŸŽฏ Three Modes

Botstrapp.ai offers three interaction modes:

Modemodel valueDescription
๐Ÿ“ก ConnectorAny model IDYou pick the model. Direct connection to the provider.
๐Ÿ”€ Router"strap"Context-aware routing โ€” picks the best model based on your conversation history.
โšก Strap"strap"Smart routing โ€” we pick the best model for your message automatically.
๐ŸŽญ LCM"lcm"Large Character Model โ€” AI with persistent personality and memory.

๐Ÿ“ก API Endpoints

Chat

POST /v1/chat/completions

Send a chat message and get a response. Supports streaming.

ParameterTypeDescription
model requiredstringModel ID, "strap" for smart routing, or "lcm" for character mode
messages requiredarrayArray of message objects: {"role": "user"|"assistant"|"system", "content": "..."}
streambooleanEnable SSE streaming (default: false)
temperaturenumberSampling temperature 0-2 (default: model-specific)
max_tokensintegerMaximum output tokens

Models & Catalog

GET/v1/models

List available models (OpenAI-compatible format).

GET/v1/catalog

Rich model catalog with providers, tiers, availability. Add ?show_all=true for all models.

Auth

POST/api/auth/signup

Create account. Body: {"email", "password", "birth_year"}. Returns API key + 1,000 attach signup bonus.

POST/api/auth/login

Login. Body: {"email", "password"}. Returns API key + balance.

GET/api/auth/me

Get current user profile and balance.

Billing & Credits

GET/api/billing/balance

Get attach balance, tier, and unlimited status.

POST/api/billing/unlimited

Toggle unlimited mode. Body: {"enabled": true}. Removes rate limits; attach is still deducted per call. Auto-deactivates when balance < 1,000 attach.

POST/api/billing/checkout

Create Stripe checkout. Body: {"package_slug": "starter"|"plus"|"pro"|"ultra"}. Card + USDC accepted.

GET/api/billing/packages

List purchasable attach packs: Starter $10 / Plus $25 / Pro $50 / Ultra $100.

GET/api/billing/model-costs

Get attach cost per model (pattern matching rules).

Partner Integration

GET/api/billing/pricing

Public attach pricing โ€” single source of truth for partner platforms. Returns packages, model costs, and denomination info.

GET/v1/costs/estimate

Estimate cost before sending. Params: ?model=gpt-5&input_tokens=1000&output_tokens=500

๐Ÿ” Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer bst_your_api_key_here

Your API key starts with bst_ and is generated when you create an account. Keep it secret โ€” it controls access to your attach balance.

๐Ÿ’Ž attach Credits

Every API call costs attach, a closed-loop platform service credit. 1 attach = $0.001, so 1,000 attach = $1.00. New accounts receive 1,000 attach free. attach is non-monetary, non-transferable between users, and has no value outside Botstrapp.ai โ€” see Terms ยง 5.

Buy more at botstrapp.ai/pricing or via the checkout API. Card + USDC accepted.

Bring your own key (BYOK)

Have your own provider API key? Use it with Botstrapp and the per-message attach price drops to 60% of the standard price.

Unlimited Mode

Toggle unlimited mode via POST /api/billing/unlimited or the โˆž checkbox in Chat. When active:

Designed for batch operations, character training, and heavy API usage.

๐Ÿ”ง Integration Example

Replace your existing OpenAI calls with Botstrapp.ai in 2 lines:

python
# Before (OpenAI only)
client = OpenAI(api_key="sk-...")

# After (Botstrapp.ai โ€” access ALL models)
client = OpenAI(
    base_url="https://botstrapp.ai/v1",
    api_key="bst_...",
)

# Now you can use any model โ€” same syntax:
client.chat.completions.create(model="gpt-4o", ...)
client.chat.completions.create(model="claude-sonnet-4-20250514", ...)
client.chat.completions.create(model="gemini/gemini-2.5-pro", ...)
client.chat.completions.create(model="groq/llama-3.3-70b-versatile", ...)
โšก Rate Limits Free tier: 10 requests/minute, 3 requests/minute for premium models. Activate unlimited mode or purchase attach to remove limits. Rate limit headers are included in every response.

๐Ÿ“ฆ Response Format

Responses follow the standard OpenAI format:

json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "gpt-4o",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9,
    "total_tokens": 21
  }
}

Cost headers

Every completion response includes cost headers so you can track spend per request:

HeaderDescription
X-Botstrapp-Cost-RawActual provider cost in USD
X-Botstrapp-CostMarked-up cost in USD โ€” what you were charged
X-Botstrapp-Markup-RatePlatform markup rate applied (1.35)
X-Botstrapp-Input-TokensInput tokens for this request
X-Botstrapp-Output-TokensOutput tokens for this request
X-Botstrapp-RouteRoute that served the request

โŒ Error Codes

CodeMeaning
401Invalid or missing API key
402Insufficient attach balance โ€” top up at /pricing
429Rate limit exceeded (activate unlimited mode to bypass)
400Bad request (missing model or messages)
503Model temporarily unavailable

Need help? support@botstrapp.ai

Home ยท Pricing ยท Chat