Skip to main content
Version: Latest

Authenticate

Check your docs version

These docs are for the new Anyscale design. If you started using Anyscale before April 2024, use Version 1.0.0 of the docs. If you're transitioning to Anyscale Preview, see the guide for how to migrate.

Locate your API key

Once you have finished the account and billing setup, you can generate your API key on the Credentials page under your account.

Use your API key

When calling the Anyscale Endpoints APIs, you must attach your API key as the bearer token as part of the request. For example:

export ANYSCALE_API_KEY=<YOUR_ANYSCALE_ENDPOINT_API_KEY>
curl https://api.endpoints.anyscale.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ANYSCALE_API_KEY" \
-d '{
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"}],
"temperature": 0.7
}'

Manage your API keys

You can revoke API keys on the Credentials page.