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

How to Use

Before you start, ensure the baseURL and apiKey refer to FriendliAI. FriendliAI is fully compatible with the OpenAI SDK, so you can follow the examples below. Choose one of the available models for the model parameter.

Chat Completion

Chat completion API that generates a response from a given conversation. Choose the example that best fits your needs:
Last modified on July 19, 2026