Create an API Key
1
Create a Friendli Suite Account
If you haven’t already, sign up for an account.
2
Sign In
Then, sign in. Friendli Suite opens your dashboard.
3
Create a FriendliAI API Key
- In the left sidebar, click Settings. Then, click API Keys.
- In the upper-right corner, click Create API Key.
- (Optional) Name your API key and set an expiration date.
- Click Create Key.
- Click Copy.
Send a Request
1
Set Up Your API Key
In your terminal, run the following command:Replace
<FRIENDLIAI_API_KEY> with your API key.2
Install the OpenAI SDK
In your terminal, run the following command:
3
Send Your Request to FriendliAI
Run the following code:
FriendliAI returns a response, similar to the following:
Control a Capability
You can control most capabilities — such as streaming or reasoning — with parameters, which you pass as either request body parameters or chat template keyword arguments. How you pass each depends on the parameter:Turn Streaming On
Some request body parameters are processed by the Friendli Engine and natively by an SDK.For example, to turn streaming on, run the following code:
Set the Reasoning Budget
Other request body parameters are processed exclusively by the Friendli Engine and are used to further shape the response.For example, to set the reasoning budget to 10,000 tokens, run the following code:
Preserve Reasoning
Chat template keyword arguments are always forwarded to the model’s chat template and used to construct the prompt to the model’s specifications.For example, to preserve reasoning, run the following code:
Use Popular Models and Your Favorite Agent or SDK
You’re ready to start building with your favorite coding agent or SDK to connect to fast, cost-efficient, and reliable open-weight models.Models
Use popular FriendliAI models.
Agents
Use your favorite agent with FriendliAI.
SDKs
Use your favorite SDK with FriendliAI.