Skip to main content

Overview

The Unbound Security AI Gateway provides a RESTful API that allows you to integrate AI capabilities into your applications while maintaining enterprise-grade security, cost control, and compliance. The API is compatible with OpenAI’s Chat Completions API format, making it easy to migrate existing integrations.

Base URL

All API requests should be made to:

Authentication

The Unbound API uses Bearer token authentication. Include your API key in the Authorization header:
Get your API key at gateway.getunbound.ai/connect.

Chat Completions

Create a completion for the provided chat messages.

Endpoint

Request Headers

Request Body

The model field in the response is always the bare model id without the provider prefix, regardless of which form you sent. The original provider is returned separately as the top-level provider field (see Response Body).

Message Object

Response Body

Each entry in choices has:

Example Request

Example Response

For plain text-only completions some providers return message.content as a string instead of a content-block array. Clients should accept both shapes — check Array.isArray(content) before iterating.

Multi-turn Conversation

The response shape is identical to the single-turn case:

Streaming Response

Pass --no-buffer so curl flushes each chunk as it arrives instead of waiting for the full response:
Streaming responses are always normalized to OpenAI’s Server-Sent Events shape, regardless of the upstream provider. Every chunk uses "object": "chat.completion.chunk" (dot notation) — including chunks served by Anthropic, Google, Vertex AI, Cohere, and Workers AI, whose non-streaming object value is "chat_completion" (underscore). Build clients that branch on object accordingly. The stream ends with data: [DONE]:
The final usage block on streaming responses contains prompt_tokens and completion_tokens only — total_tokens is not emitted on the stream. Sum the two client-side if you need it.

List Models

Retrieve available models and their pricing from the gateway

Python SDK

Use the Unbound Python SDK for drop-in OpenAI compatibility