LowRefusal Documentación de la API
Connect your OpenAI SDK, Anthropic SDK or compatible client to this instance https://lowrefusal.com. Use an API key from the dashboard. The table lists each protocol’s complete endpoint and authentication method.
1. Endpoints de protocolos nativos
| Método y ruta | Autenticación | Protocol contract |
|---|---|---|
POST https://lowrefusal.com/v1/chat/completions | Authorization: Bearer … | OpenAI Chat Completions · Messages, tool calls and SSE streaming |
POST https://lowrefusal.com/v1/responses | Authorization: Bearer … | OpenAI Responses · Stateless forwarding with store: false |
POST https://lowrefusal.com/v1/messages | x-api-key · anthropic-version: 2023-06-01 | Anthropic Messages · Native content blocks and tool-use events |
GET https://lowrefusal.com/v1/models | Público | Public model IDs, rates and capacity |
GET https://lowrefusal.com/v1/models/{id} | Público | Look up a single full model ID or routing alias |
GET https://lowrefusal.com/v1/me | Authorization: Bearer … | Balance, tier and concurrency for the key’s account |
OpenAI SDK https://lowrefusal.com/v1 Anthropic SDK https://lowrefusal.com
Browser clients can preflight /v1/* and authenticate a cross-origin call with the caller’s Bearer token or x-api-key. Dashboard sessions use same-origin connections.
Autenticación y primera conexión
Create a project key in the dashboard and place it in the application server’s environment. Call /v1/me in that same shell to check the account and its available credit.
Usar una clave existente
A filled key stays in this tab’s memory. Revoke created keys in the dashboard.
export BF16_API_KEY='YOUR_INSTANCE_KEY'curl -fsS 'https://lowrefusal.com/v1/me' \
-H "Authorization: Bearer $BF16_API_KEY"balance_usd·available_usd- Current and available balances in US dollars, with pending reservations excluded from available credit.
tier·requests_per_minute- Account tier and its per-minute request allowance.
current_concurrency·concurrency_limit- Number of active requests and the applicable concurrency limit.
Enviar una solicitud
curl 'https://lowrefusal.com/v1/chat/completions' \
-H "Authorization: Bearer $BF16_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"messages":[{"content":"Hello!","role":"user"}],"model":"deepseek/deepseek-v4.1-flash-uncensored"}'Campos de solicitud y respuesta
| Protocolo | Request | Leer la respuesta |
|---|---|---|
| Chat | model, messages[]. Each message has role and content. Include max_tokens, tools or stream when supported. | choices[].message.contentSSE choices[].delta · [DONE] |
| Responses | model, input. Input accepts text or message items. Use instructions, max_output_tokens and stream. | output[].content[]SSE response.output_text.delta · response.completed |
| Messages | model, messages[], max_tokens. Place system instructions in the top-level system field. Use user and assistant messages. | content[] · stop_reasonSSE content_block_delta · message_stop |
A Chat upstream may return reasoning_content or a JSON Schema result. When Messages includes thinking content, preserve the returned thinking block and signature in later turns. Use the protocol’s terminal event to detect stream completion. Check usage and status after an early disconnect.
Responses is stateless. Include required history in input. previous_response_id, conversation and background=true return 400. Chat generates one result per request and accepts max_completion_tokens as its output cap.
Use native tool definitions and results. Chat uses tools and tool_calls, while Messages uses tool_use and tool_result. Image input, thinking blocks and structured output depend on the selected model and upstream. Keep conversation history and tool results in your client for subsequent turns.
Catálogo de modelos y enrutamiento automático
curl -fsS 'https://lowrefusal.com/v1/models'Read each id in data. A concrete model’s bf16 object describes context_window, max_output_tokens, max_messages, max_tools and pricing_usd_per_1m (input, cached input and output). Budget for the prompt, conversation history, tool definitions and reserved output together.
Models with capability metadata also expose family, max_images, supports_vision, supports_tools, supports_reasoning and supports_json_schema. Check these fields before enabling images, tools or structured output.
Each request accepts up to 100,000 messages and 1,024 tool definitions. Available input is also bounded by the model context, reserved output and the instance HTTP request size limit.
bf16/auto- Let the instance choose its default configured route.
bf16/auto:fast- Use the fast route for short, latency-sensitive tasks.
bf16/auto:coding- Use the instance’s coding route.
bf16/auto:reasoning- Use the instance’s reasoning route.
Clients using the [1m] marker can append it to the concrete ID of a model with at least one million tokens of context. A routing alias resolves to a concrete model that fits the request’s price cap.
View model IDs and prices ↗2. Cabeceras opcionales de presupuesto y telemetría
X-BF16-Max-Price-Per-M-Output- Set the maximum acceptable USD price per million output tokens, for example 1.20. The gateway checks the selected model before forwarding.
X-BF16-Include-Cost: true- A non-streaming success includes a numeric USD usage.cost and X-BF16-Cost-USD. For streams, read the final usage or cost event or the HTTP trailer after the stream ends.
Idempotency-Key- Give each logical non-streaming call a unique key. Retry with the same account, endpoint, payload, telemetry settings and key. Replayed responses carry Idempotency-Replayed: true. Recent successes can replay from memory. After eviction or restart the gateway can return 409 for 24 hours to prevent a duplicate charge.
REQUEST_ID=$(uuidgen)
curl -sS -i 'https://lowrefusal.com/v1/chat/completions' \
-H "Authorization: Bearer $BF16_API_KEY" \
-H 'Content-Type: application/json' \
-H 'X-BF16-Max-Price-Per-M-Output: 1' \
-H 'X-BF16-Include-Cost: true' \
-H "Idempotency-Key: $REQUEST_ID" \
--data '{
"max_tokens": 32,
"messages": [
{
"content": "Reply with OK.",
"role": "user"
}
],
"model": "deepseek/deepseek-v4.1-flash-uncensored"
}'Keep the same REQUEST_ID when retrying the curl command. Generate a new value for a new logical request.
Límites de solicitudes
All keys owned by an account share its limits. Settled top-ups determine the tier, subject to instance capacity.
| Nivel | Recargas acumuladas | Concurrencia | Solicitudes/min | Entrada máxima |
|---|---|---|---|---|
| Free | No top-up | 3 | 180 | Dentro del contexto del modelo |
| Tier 1 | $10+ | 10 | 600 | Dentro del contexto del modelo |
| Tier 2 | $100+ | 30 | 1800 | Dentro del contexto del modelo |
| Tier 3 | $500+ | 50 | 3000 | Dentro del contexto del modelo |
| Tier 4 | $2,000+ | 100 | 6000 | Dentro del contexto del modelo |
Instance concurrency limit · 12
Cartera ↗ · Contact the operator ↗
Límites, errores y reintentos
For rate-limited inference calls inspect x-ratelimit-limit-requests, x-ratelimit-remaining-requests and x-ratelimit-reset-requests. The reset is a Unix timestamp in seconds. On 429 or temporary overload, wait the number of seconds in Retry-After when present.
| HTTP | Causa y acción |
|---|---|
| 400 | Validate the JSON, protocol fields and output budget. context_length_exceeded means input and reserved output exceed the window. too_many_messages means the message list is too long. too_many_tools exceeds the tool limit. price_cap_exceeded exceeds the request’s price cap. |
| 401 | Missing, invalid or revoked key. Verify the header with /v1/me. |
| 402 | Available credit cannot cover the reservation. Reduce the output cap or top up. |
| 403 | If the key restricts sources, check the calling server’s IP against its allowed CIDR ranges. |
| 404 | Check the route and copy the complete current model ID from /v1/models. |
| 409 | Check the idempotency key, original request and usage log before starting a new logical operation. |
| 413 | The request body is too large. Reduce messages or attachments. |
| 429 | Account concurrency or the per-minute allowance is exhausted. Reduce parallel work and wait. |
| 502 / 503 | Check the status page, this protocol’s upstream and instance capacity. Use bounded exponential backoff for temporary unavailability. |
Read error.type, error.message and the optional error.code. Messages adds a top-level type of error. For accepted requests use X-Request-ID to locate the record in the dashboard. X-BF16-Model identifies the selected model.
{
"error": {
"type": "not_found_error",
"code": "model_not_found",
"message": "未知模型",
"param": null
}
}3. Retención de instrucciones y respuestas
The gateway forwards requests to the configured upstream and sets store=false on Responses. SQLite keeps billing and operational metadata such as model, status, timestamps, token counts and charges. The gateway database does not store inference prompts or generated replies.
Idempotent replay briefly keeps recent non-streaming successful responses in process memory. The upstream provider, reverse proxy and client each have separate logging settings.