API Reference

OpenAI-compatible endpoints. Base URL: https://gateway.broadcomms.net

Gateway Proxy Endpoints

These endpoints are OpenAI-compatible — any OpenAI SDK works by changing base_url.

POST/v1/chat/completions

Create a chat completion. Supports streaming via SSE.

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., gpt-4o-mini, claude-sonnet-4)
messagesarrayYesArray of message objects with role and content
streambooleanNoEnable SSE streaming (default: false)
temperaturenumberNoSampling temperature (0-2)
max_tokensintegerNoMaximum tokens to generate
top_pnumberNoNucleus sampling (0-1)
stoparrayNoStop sequences

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1712345678,
  "model": "gpt-4o-mini",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Hello!" },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 5,
    "total_tokens": 14
  }
}
GET/v1/models

List all available models with pricing metadata.

{
  "object": "list",
  "data": [
    { "id": "gpt-4o", "object": "model", "owned_by": "openai", "pricing": { "input": 2.50, "output": 10.00 } },
    { "id": "claude-sonnet-4", "object": "model", "owned_by": "anthropic", "pricing": { "input": 3.00, "output": 15.00 } },
    ...
  ]
}

Management Endpoints

These use JWT authentication (Bearer token from login), not API keys.

POST/api/v1/gateway/orgCreate organization
GET/api/v1/gateway/orgGet current organization
GET/api/v1/gateway/org/membersList organization members
POST/api/v1/gateway/keysCreate API key
GET/api/v1/gateway/keysList API keys
DELETE/api/v1/gateway/keys/{id}Revoke API key
GET/api/v1/gateway/providersList available providers
GET/api/v1/gateway/billing/statusGet billing status
POST/api/v1/gateway/billing/checkoutCreate Stripe checkout session
GET/api/v1/gateway/billing/portalOpen Stripe billing portal
GET/api/v1/gateway/billing/usageGet usage summary

Error Responses

Errors follow the OpenAI format:

{
  "error": {
    "message": "Rate limit exceeded: 20 RPM",
    "type": "rate_limit",
    "code": "rate_limit"
  }
}
CodeHTTPDescription
auth_error401/403Invalid or missing API key
rate_limit429RPM or budget limit exceeded
model_not_found404Unknown model ID
context_length_exceeded400Input too long for model
content_filter400Content blocked by safety filters
server_error500+Provider or gateway error
timeout504Provider request timed out

Interactive API Explorer

The full OpenAPI specification is available at /docs (Swagger UI) and /redoc (ReDoc) on the backend.