Skip to main content
All API requests to VoidAI require authentication using an API key. Your API key should be included in the Authorization header of every request.

API Key Format

VoidAI API keys follow this format:
sk-voidai-xxxxxxxxxxxxxxxxxxxx

Making Authenticated Requests

Include your API key in the Authorization header using the Bearer token scheme:
from openai import OpenAI

client = OpenAI(
    api_key="sk-voidai-your_key_here",
    base_url="https://api.voidai.app/v1"
)

Managing API Keys

You can create and manage multiple API keys from your dashboard. Each key can be:
  • Named for easy identification (e.g., “Production”, “Development”)
  • Enabled/Disabled without deletion
  • Deleted permanently when no longer needed
Treat your API keys like passwords. Never commit them to version control, share them publicly, or include them in client-side code.

Environment Variables

We recommend storing your API key in an environment variable:
VOIDAI_API_KEY=sk-voidai-your_key_here

Authentication Errors

Error CodeDescription
MISSING_HEADERNo Authorization header provided
INVALID_FORMATHeader format is incorrect (must be Bearer <token>)
INVALID_KEYThe API key does not exist or is incorrect
ACCOUNT_DISABLEDYour account has been disabled
IP_ACCESS_DENIEDRequest IP is not in your allowlist

Example Error Response

{
  "error": {
    "message": "Invalid API key provided",
    "type": "api_error",
    "code": "INVALID_KEY",
    "reference_id": "req_1701691200_abc123",
    "timestamp": "2024-12-04T12:00:00.000Z"
  }
}

IP Allowlisting

For enhanced security, you can restrict API access to specific IP addresses from your dashboard. When enabled, requests from non-allowlisted IPs will be rejected.
IP allowlisting is optional. If no IPs are configured, requests from any IP address will be accepted.

Best Practices

Never hardcode API keys in your source code. Use environment variables or secure secret management systems.
Periodically regenerate your API keys, especially for production environments.
Create different API keys for development, staging, and production environments.
Regularly check your dashboard for unusual activity or unexpected usage patterns.