API // v1
One familiar API.
Your open model.
BrokenGPT exposes the core OpenAI Chat Completions shape, including server-sent event streaming. Point an existing client at your BrokenGPT base URL and use a BrokenGPT key.
Create and use a key
Create a secret from the API keys dashboard. The full value is shown once and only its SHA-256 hash is stored. Send it as a Bearer token.
curl https://brokengpt.com/v1/chat/completions \
-H "Authorization: Bearer $BROKENGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "broken-one",
"messages": [
{"role": "user", "content": "Explain continuous batching."}
]
}'Chat completions
/v1/chat/completionsThe public model alias, currently broken-one.
System, user, and assistant messages with string content.
Return incremental SSE chunks, ending with [DONE].
Capped by the caller's plan and the model context window.
Sampling temperature passed to the configured provider.
Nucleus sampling control.
Stream the answer
Set stream: true. Each event contains a chat.completion.chunk. Usage is included in the terminal chunk when the provider reports it; otherwise BrokenGPT records a conservative estimate.
const response = await fetch(
"https://brokengpt.com/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BROKENGPT_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "broken-one",
messages: [{ role: "user", content: "Write a parser." }],
stream: true
})
}
);Errors and request IDs
Every API response includes x-request-id. Keep it when contacting support. Errors use an OpenAI-style error object.
Pricing & limits
Billing is pay-as-you-go. Add credits to your balance and spend them per token — no monthly subscription. See the pricing page for current rates and the billing dashboard to top up.
$0.50 per 1M input tokens$2.00 per 1M output tokensRequests are rate-limited per keyCredits never expireWhen your balance reaches $0, requests return 429 until you add credits. Both input and output tokens are metered on every call.