Get started

Authentication

Bearer keys, how to get one, and how to keep it safe.


The Civix API authenticates with a bearer token on every request:

Authorization: Bearer YOUR_CIVIX_API_KEY

The OpenAI SDKs do this for you when you pass api_key.

Getting a key

Civix is in private beta. Keys are issued on request rather than through self-service signup. Get in touch and tell us what you are building, and we will arrange access.

Keeping keys safe

A key grants full access to your account's inference. Treat it like a password.

  • Never put a key in client-side code. Anything in a browser, a mobile app, or a public repository is exposed. Call the API from your own backend and let that backend hold the key.
  • Use environment variables, not literals in source.
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CIVIX_API_KEY"],
    base_url="https://api.civix.com.vn/v1",
)
  • Rotate a key immediately if it may have leaked. Contact us and we will issue a replacement and revoke the old one.

Failed authentication

A missing, malformed, or unauthorised key returns 401 with AUTHENTICATION_ERROR:

{
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "type": "authentication_error",
    "message": "Missing or invalid API key.",
    "request_id": "req_0b903419521e4e2c",
    "retryable": false
  }
}

This is never retryable — retrying with the same key will always fail. See Errors.