FriendliAI Provider Guide
FriendliAI is a Tier-2 catalog provider: OpenAI-wire-compatible with no
behavioural quirks, so its entire integration is one JSON file
(src/lib/providers/catalog/friendli.json) rather than hand-written code. That
file is the source of truth for everything on this page.
Key Facts
- Provider id:
friendli - Protocol: OpenAI-compatible (
/chat/completions) - Base URL:
https://api.friendli.ai/serverless/v1 - Default model:
zai-org/GLM-5.3 - Models in catalog: 7
- Streaming: supported
- Tool calling: supported (native)
- Structured output: supported — but not combined with tools in one
request: Friendli rejects
tools+response_formattogether with HTTP 422 ("response_format" field cannot be set when tools are specified). NeuroLink handles this the same way as Groq (isToolsSchemaConflictError): it retries the call withoutresponse_format. - Embeddings: not supported
- Billing: free-tier
- Key format: none declared
- Rate limits: tight — pace requests at least 20 seconds apart
Quick Start
1. Get an API key
- Visit: https://suite.friendli.ai/ and sign in
- Create a Personal Access Token for the serverless endpoints
- New accounts start with trial credit; confirm current billing terms in the console before heavy use
- Set
FRIENDLI_API_KEYin your .env file
2. Configure
export FRIENDLI_API_KEY=your-api-key
export FRIENDLI_MODEL=zai-org/GLM-5.3 # optional — overrides the default model
export FRIENDLI_BASE_URL=https://api.friendli.ai/serverless/v1 # optional — self-hosted or proxy
3. Use it
import { NeuroLink } from "@juspay/neurolink";
const neurolink = new NeuroLink();
const result = await neurolink.generate({
input: { text: "Explain context windows in one paragraph." },
provider: "friendli",
model: "zai-org/GLM-5.3",
});
console.log(result.content);
# CLI
npx @juspay/neurolink generate "Hello" --provider friendli
Per-request credentials work as they do for every provider:
await neurolink.generate({
input: { text: "Hello" },
provider: "friendli",
credentials: { friendli: { apiKey: process.env.FRIENDLI_API_KEY } },
});
Models
| Model | Context | Vision | $/M in · out | Notes |
|---|---|---|---|---|
zai-org/GLM-5.3 ⭐ | 1M | no | $1.4 / $4.4 (cached $0.26) | Recommended — the only model in this roster capability-probed end to end (real tool call, SSE streaming, json_object). Heavy internal reasoner via reasoning/reasoning_content — give it a generous maxTokens. Rejects image/video input (HTTP 422). |
zai-org/GLM-5.3-Flash | 1M | no | — | Lighter/faster sibling of the default; roster-listed only, not itself capability-probed; fallback. |
zai-org/GLM-5.2 | 1M | no | — | Prior GLM generation; roster-listed only; fallback. |
zai-org/GLM-5.1 | 1M | no | — | Prior GLM generation; roster-listed only; fallback. |
google/gemma-4-31B-it | 1M | no | — | Google Gemma 4 31B instruct-tuned; roster-listed only; fallback. |
deepseek-ai/DeepSeek-V3.2 | 1M | no | — | DeepSeek V3.2; roster-listed only; fallback. |
MiniMaxAI/MiniMax-M2.5 | 1M | no | — | MiniMax M2.5; roster-listed only; fallback. |
Context window shown is the catalog default of 1,048,576 tokens; the default
max output is 131,072 tokens (zai-org/GLM-5.3's documented per-request
output ceiling, distinct from the context window).
Fallback order when the default is unavailable: zai-org/GLM-5.3-Flash →
zai-org/GLM-5.2 → zai-org/GLM-5.1 → google/gemma-4-31B-it →
deepseek-ai/DeepSeek-V3.2 → MiniMaxAI/MiniMax-M2.5.
Verification status
Tier-2 onboarding requires evidence before a provider is accepted, and
pnpm run verify:provider-onboarding gates it in CI. This is what the
catalog records for FriendliAI:
| Probe | Result |
|---|---|
| Roster | authenticated GET /serverless/v1/models, HTTP 200, 2026-09-06 |
| Auth rejection | HTTP 401, 2026-09-06 |
| Live capability sweep | 2026-09-06, probed against the default model (zai-org/GLM-5.3) with generous pacing after an initial fast-cadence run tripped Friendli's rate limit. Chat, streaming (SSE, 62 events, terminal [DONE]), and a real structured tool call (finish_reason=tool_calls) all passed. response_format: json_object returned 200; tools + a JSON schema together returned HTTP 422. A real image part returned HTTP 422 ("This model does not support image/video inputs"). Only the default model was probed end to end; the other 6 roster ids are roster-verified by id only. |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Invalid Friendli API key | FRIENDLI_API_KEY unset or wrong | Check the key at https://suite.friendli.ai/ |
| Model not found | The roster changed since 2026-09-06 | Pick a current id from the authenticated /serverless/v1/models roster |
| Frequent 429s | Friendli's rate limits are tight | Pace requests at least 20 seconds apart and retry |
| HTTP 422 when tools + schema are both set | Friendli rejects response_format when tools is present | NeuroLink retries automatically without response_format (same handling as Groq) |
Empty content at a small maxTokens | zai-org/GLM-5.3 spends its budget on reasoning_content first | Give reasoning prompts a generous maxTokens budget |
See also
- Provider setup overview
- All providers
- Tier-2 onboarding — how this provider's JSON becomes a working integration
- Provider feature compatibility