Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.hitopen.com/llms.txt

Use this file to discover all available pages before exploring further.

Newapi uses a multi-level authentication system. The method you use depends on which API category you are calling.

AI Model API authentication

All AI Model API endpoints (/v1/chat/completions, /v1/embeddings, etc.) authenticate with a Bearer token that starts with sk-. You create these tokens in Token Management in the Newapi console. Include your token in the Authorization header of every request:
Authorization: Bearer sk-your-token-here
Example — chat completion:
curl -X POST "https://YOUR_NEWAPI_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer sk-your-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
AI Model API tokens always start with sk-. Do not use a system access token for these endpoints.

Management API authentication

Management API endpoints (/api/...) support two authentication methods. Choose one.

New-Api-User header

Some management endpoints require you to identify the acting user by including their user ID in the request:
New-Api-User: {user_id}
The user_id must match the account that is currently authenticated. Endpoint reference pages indicate when this header is required.

Permission levels

Management API endpoints are protected by one of four permission levels:
LevelDescription
PublicNo authentication required
UserRequires a valid session or access token
AdminRequires administrator privileges
RootHighest privilege level; reserved for system-level operations
Each endpoint’s reference page shows its required permission level.