Skip to main content
Every API request needs a Perceptron API key. Use a key from the organization that owns the files and other resources your application accesses.

Create an API key

Get your key from the Perceptron platform

Join Discord

Get help and see what others are building

Set the key in your environment

For Bash or Zsh:
For Windows PowerShell:
Start your Python process from that terminal. A notebook or editor that was already running may need its kernel or process restarted to receive the new environment variable.

Configure the Python client

The Perceptron SDK reads PERCEPTRON_API_KEY. You can also pass the key explicitly. Select the Perceptron provider for these guides:
Reuse this client for requests with the same credentials. Create a separate client when using another organization’s key. The key is read when this code runs; changing the environment later does not update an existing client. timeout is a client setting, not a model parameter. The SDK does not automatically retry requests; its retries setting is accepted for compatibility but does not enable retries. See Error messages before adding a retry policy.

Authenticate an HTTP request

Direct HTTP requests use the Authorization header. For example, list the models:
Do not put the key in the URL, message content, or a media URL. Keep it in a server-side environment or secret store, exclude secret files from source control, and avoid logging authorization headers. Browser and mobile applications should call your backend rather than embed the API key in distributed code.

Resolve authentication problems

For error fields, diagnostic headers, and retry behavior, see Error messages.