Get started - Workers AI API
In this guide, you will get started with Workers AI, experiment with a large language model (LLM), using the Workers AI REST API.
 Before you begin
Sign up for a Cloudflare account if you have not already.
 1. Get an API token
To create an API token:
- Log in to the Cloudflare dashboard.
- Select the user icon on the top right of your dashboard > My Profile.
- Select API Tokens > Create Token.
- You can go to Workers AIs template > Use template or go to Create Custom Token > Get started.
 2. Run a model via API
After creating your token, you can authenticate and make requests to the API using your API token in the request headers. For example, here is an API request to get all deployments in a project.
In this example, we will run the @cloudflare/meta-llama/llama-2-7b model:
Try it with one of your projects by replacing {ACCOUNT_ID}, and {API_token}. Refer to Find your account ID for more information.
The API response will look like the following:
 Exploring other models
This example uses the @cf/meta/llama-2-7b-chat-int8, but you can use any of the models in our catalog and just replace {model} the the desired model name
api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/{model}