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/v1Authentication
Every request requires an API key passed in the Authorization header:
Authorization: Bearer sk_unii_your_api_key_hereGenerate 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:
| Endpoint | Method | Description |
|---|---|---|
| Verify API key | POST | Verify that your API key is valid and active |
| Chat completions | POST | Generate a chat completion response |
| Stream response | POST | Stream 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": { "message": "Invalid API key.", "type": "authentication_error", "code": 401}}Common status codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request — malformed request body or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — API key lacks permission |
| 429 | Too Many Requests — rate limit exceeded |
| 500 | Internal 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
- Follow the Quickstart to make your first API call.
- Read the Chat completions endpoint documentation.
- Learn about streaming for real-time responses.