1. API integration explanation
  • Start
    • Product Intrduction
    • Quick to use
    • Using Nexhina in AI Coding Tools
  • API integration explanation
    • Quick Start
    • Getting an API Key
    • Authentication
    • Request URL
    • HTTP Status Codes
    • Streaming Output Guide
  • API Endpoints
    • Chat
      • Chat Completion
    • Models
      • List Available Models
    • Responses
      • Responses API
    • Embeddings
      • Text Embedding
    • Images
      • Text-to-Image
      • Image-to-Image
    • Audio
      • Text-to-Speech (TTS)
      • Speech-to-Text (STT)
      • Audio Translation
    • Video
      • Generate Video
    • Moderation
      • Content Moderation
    • Rerank
      • Rerank
  • Platform-related
    • Platform agreement
    • Privacy Policy
    • General Questions
  1. API integration explanation

Authentication

Nexhina uses Bearer Token authentication, which is required for all interfaces.

Header Format#

Authorization: Bearer sk-your-api-key

cURL Example#

Configuring in the SDK#

Authentication Failure Behavior#

Returns HTTP status code 401
Response body:
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}
Common causes:
The Key is incorrect or missing the sk- prefix
The Key has been deleted or disabled
The Header format is incorrect (there should be only one space between Bearer and sk-)

Modified at 2026-06-30 09:30:29
Previous
Getting an API Key
Next
Request URL
Built with