BetopiaAIBetopiaAIBETA
API Reference

Betopia API

Use your Betopia API key to call LLM models directly. The API is OpenAI-compatible — swap the base URL and key and existing integrations work immediately.

Base URL: https://api.betopia.ai

Chat Completions

POST/v1/chat/completions

Send a list of messages and receive a completion. Supports system, user, and assistant roles. Add "stream": true for SSE — see .

python
import requests

API_KEY  = "sk_your_api_key_here"
BASE_URL = "https://api.betopia.ai"

response = requests.post(
    f"{BASE_URL}/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    },
    json={
        "model": "gpt-5.4-mini",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user",   "content": "Explain quantum computing in simple terms."},
        ],
        "max_completion_tokens": 512,
        "temperature": 0.7,
    },
)

data = response.json()
print(data["content"])
print(f"Tokens: {data['input_tokens']} in / {data['output_tokens']} out")

Response

response
{
  "request_id":    "req_a1b2c3d4e5",
  "model":         "gpt-5.4-mini",
  "content":       "Quantum computing uses quantum bits (qubits) that can exist in multiple states at once...",
  "input_tokens":  24,
  "output_tokens": 187,
  "latency_ms":    430
}
request_idstringUnique request identifier for debugging
modelstringModel that processed the request
contentstringGenerated text response
input_tokensintegerTokens consumed by your prompt
output_tokensintegerTokens in the generated response
latency_msintegerEnd-to-end inference time in ms