Skip to Content
unii.docs
Api

API Overview

An overview of the Unii API, including base URL, authentication, and available endpoints.

Overview

The Unii API provides programmatic access to chat completions, knowledge bases, and streaming responses. All endpoints use HTTPS and return JSON responses.

Base URL

All API requests are sent to:

https://api.unii.dev/v1

Authentication

Every request requires an API key passed in the Authorization header:

Authorization: Bearer sk_unii_your_api_key_here

Generate and manage your API keys in the Unii Developer Console. See Authentication for details.

Warning

Never expose your API key in client-side code or public repositories. Use environment variables or a secrets manager to keep credentials secure.

Available endpoints

The Unii API provides the following endpoints:

EndpointMethodDescription
Verify API keyPOSTVerify that your API key is valid and active
Chat completionsPOSTGenerate a chat completion response
Stream responsePOSTStream a chat completion response in real time

Response format

All successful responses return a JSON object. The structure varies by endpoint.

Error format

Errors return a JSON object with a status code and message:

error.json
{"error": {  "message": "Invalid API key.",  "type": "authentication_error",  "code": 401}}

Common status codes

CodeMeaning
200Success
400Bad Request — malformed request body or invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — API key lacks permission
429Too Many Requests — rate limit exceeded
500Internal Server Error — unexpected server error

Rate limits

API requests are rate-limited based on your plan. When you exceed the limit, the API returns 429 Too Many Requests. Wait before retrying or contact support to discuss higher limits.

Note

Exact rate limits depend on your plan. Check the Unii Developer Console for your current limits.

SDKs

For a more convenient experience, use one of the official SDKs:

Next steps

On this page