Chat Completions
Endpoint
Section titled “Endpoint”POST https://api.bve.me/v1/chat/completionsRequires Authorization: Bearer sk-bve-YOUR_KEY.
This endpoint proxies directly to Fuelix /chat/completions. The request body and response shape follow the OpenAI Chat Completions API. Streaming (SSE) is supported.
Request body
Section titled “Request body”{ "model": "gpt-4o", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is 2 + 2?" } ], "stream": false}| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g. gpt-4o) |
messages | array | Yes | Array of message objects |
stream | boolean | No | Enable SSE streaming |
temperature | number | No | Sampling temperature |
top_p | number | No | Nucleus sampling |
max_tokens | integer | No | Maximum tokens to generate |
stop | string | array | No | Stop sequences |
presence_penalty | number | No | Presence penalty |
frequency_penalty | number | No | Frequency penalty |
user | string | No | End-user identifier |
seed | integer | No | Deterministic seed |
Any additional fields supported by Fuelix are forwarded as-is.
Response headers
Section titled “Response headers”In addition to upstream headers, BVE Gateway adds:
| Header | Description |
|---|---|
X-Request-Id | UUID for this request (generated per request) |
X-BVE-Latency | Total gateway latency in milliseconds |
Only a safe subset of Fuelix response headers are forwarded to the client:
content-typecache-controlx-request-idx-quota-allowedx-quota-availablex-quota-reset
Example — non-streaming
Section titled “Example — non-streaming”curl https://api.bve.me/v1/chat/completions \ -H "Authorization: Bearer sk-bve-YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [{ "role": "user", "content": "What is 2 + 2?" }] }'Response:
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1716288000, "model": "gpt-4o", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "4" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 14, "completion_tokens": 1, "total_tokens": 15 }}Example — streaming
Section titled “Example — streaming”See Streaming for full streaming documentation.
curl https://api.bve.me/v1/chat/completions \ -H "Authorization: Bearer sk-bve-YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [{ "role": "user", "content": "Count to 3." }], "stream": true }'Body size limit
Section titled “Body size limit”Request bodies larger than 10 MB are rejected with 413 Request Entity Too Large:
{ "error": { "message": "Request body too large", "type": "invalid_request_error", "code": "request_too_large" }}OpenAI SDK
Section titled “OpenAI SDK”import OpenAI from 'openai';
const client = new OpenAI({ apiKey: 'sk-bve-YOUR_KEY', baseURL: 'https://api.bve.me/v1',});
const response = await client.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: 'What is 2 + 2?' }],});