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
- Log in to the Zapi Dashboard .
- Navigate to the Keys management section.
- Click on Generate New Key.
- 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 Unauthorizedstatus.
Error Codes
| Status Code | Description |
|---|---|
401 Unauthorized | Your API key is missing or invalid. |
403 Forbidden | Your account is suspended or rate-limited. |
Last updated on