Skip to Content
unii.docs
Api

Verify API key

Check that your API key is valid and active.

Overview

Use this endpoint to verify that your API key is valid and active. It returns key metadata without consuming a chat completion request.

Endpoint

POST/v1/verify-key

Authentication

This endpoint requires a Bearer token in the Authorization header:

Authorization: Bearer sk_unii_your_api_key_here

Request examples

curl -X POST https://api.unii.dev/v1/verify-key \-H "Authorization: Bearer $UNII_API_KEY"

Response

200 OK

A valid API key returns a JSON object with key metadata:

response.json
{"valid": true,"keyPrefix": "sk_unii_...","createdAt": "2025-01-15T10:30:00Z"}

Errors

Status codeMeaning
401The API key is missing, invalid, or expired
403The API key is valid but has been revoked
error.json
{"error": {  "message": "Invalid API key.",  "type": "authentication_error",  "code": 401}}

Tip

Call this endpoint during application startup to fail fast if the API key is invalid, rather than waiting for the first chat completion to fail.

Next steps

On this page