Skip to Content
API ReferenceAuthentication

Authentication

Every request to the Zapi API must be authenticated using an API Key.

Your API key securely associates your API requests with your account and billing plan. Keep your API key secure and do not expose it in public repositories or client-side code.

Generating an API Key

  1. Log in to the Zapi Dashboard .
  2. Navigate to the Keys management section.
  3. Click on Generate New Key.
  4. Copy the newly generated key. It will begin with zp_.

Making Authenticated Requests

You can authenticate your requests by passing the API key in the JSON body of your POST request.

Example

Request Payload
{ "apikey": "zp_xxxxxxxxxxxxxxxxxxxxxx", "prompt": "Hello, world!" }

Note: If an invalid, expired, or missing API key is provided, the API will respond with a 401 Unauthorized status.

Error Codes

Status CodeDescription
401 UnauthorizedYour API key is missing or invalid.
403 ForbiddenYour account is suspended or rate-limited.
Last updated on