Skip to content
Orvanov0.2.0

invalid_api_key

HTTP status: 401 · Code: invalid_api_key

The API key is unknown, expired, or belongs to another project.

The API key is unknown, expired, revoked, or belongs to another project.

Create a new key in the console under the project’s API keys and set it in your server’s environment (for example ORVANO_API_KEY). Check that the endpoint and project match the install that issued the key.

Every SDK throws one error type for a failed call. Match on its code, which is always invalid_api_key for this error, never on the message.

import { ErrorCode, OrvanoError } from '@orvano/js'
try {
// your Orvano call
} catch (error) {
if (error instanceof OrvanoError && error.code === ErrorCode.invalidApiKey) {
// handle invalid_api_key
} else {
throw error
}
}

The error also carries the HTTP status (401), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.