Create an API Key
Send a Request
Once you create your FriendliAI API Key, you’re ready to send your first request:Set Up Your API Key
In your terminal, run the following command:Replace
<FRIENDLIAI_API_KEY> with your API Key.Send Your Request to FriendliAI
Run the following code:If you’d like to use a different model, replace
zai-org/GLM-5.2 with another model. To browse all models, see Models > Model APIs.FriendliAI returns a response, similar to the following:
Use Your 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. Choose how you work:Agents
Use your favorite agent with FriendliAI.
SDKs
Use your favorite SDK with FriendliAI.