Authentication
The two ways to submit an API key, precedence, and the failure envelope.
All protected /v1 endpoints share one credential extraction rule.
Submission styles
| Style | Header | Convention |
|---|---|---|
| Style 1 | x-api-key: <UNIO_API_KEY> | Anthropic protocol |
| Style 2 | Authorization: Bearer <UNIO_API_KEY> | OpenAI protocol |
Both styles are accepted on every entry protocol: the OpenAI endpoints also accept
x-api-key, and the Messages endpoint also accepts Bearer. When both headers are present,
x-api-key wins.
The Bearer prefix in the Authorization header is case-sensitive.
Authentication failures
Missing, invalid, revoked, disabled, or expired keys are rejected before the request runs and return
401, in the structure of the protocol you called:
OpenAI shape (Chat Completions, Responses, /v1/models):
{
"error": {
"message": "Incorrect API key provided.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}Anthropic shape (/v1/messages):
{
"type": "error",
"error": { "type": "authentication_error", "message": "invalid x-api-key" },
"request_id": "..."
}See Errors for the full list.
Request identifiers
Every response carries an X-Request-ID header — the trace identifier for the request:
- You may send your own
X-Request-ID(up to 128 chars; ASCII letters, digits, and. _ - :only). The platform adopts it verbatim across all logs for the request; - Missing or non-conforming values are replaced with a generated one.
Include it when troubleshooting or filing a support ticket.