Skip to main content
You can use LlamaIndex to interact with FriendliAI. This makes migration of existing applications already using LlamaIndex particularly easy.

How to Use

Before you start, ensure you’ve already obtained the API_KEY from the Friendli Suite > Personal Settings > API Keys.

Instantiation

Now you can instantiate the model object and generate chat completions. The default model (i.e. zai-org/GLM-5.2) will be used if no model is specified.

Chat Completion

Generate a response from a given conversation.

Completion

Generate a response from a given prompt.
Last modified on July 19, 2026