Skip to main content

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_format together 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 without response_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​

  1. Visit: https://suite.friendli.ai/ and sign in
  2. Create a Personal Access Token for the serverless endpoints
  3. New accounts start with trial credit; confirm current billing terms in the console before heavy use
  4. Set FRIENDLI_API_KEY in 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​

ModelContextVision$/M in · outNotes
zai-org/GLM-5.3 ⭐1Mno$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-Flash1Mno—Lighter/faster sibling of the default; roster-listed only, not itself capability-probed; fallback.
zai-org/GLM-5.21Mno—Prior GLM generation; roster-listed only; fallback.
zai-org/GLM-5.11Mno—Prior GLM generation; roster-listed only; fallback.
google/gemma-4-31B-it1Mno—Google Gemma 4 31B instruct-tuned; roster-listed only; fallback.
deepseek-ai/DeepSeek-V3.21Mno—DeepSeek V3.2; roster-listed only; fallback.
MiniMaxAI/MiniMax-M2.51Mno—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:

ProbeResult
Rosterauthenticated GET /serverless/v1/models, HTTP 200, 2026-09-06
Auth rejectionHTTP 401, 2026-09-06
Live capability sweep2026-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​

SymptomCauseFix
Invalid Friendli API keyFRIENDLI_API_KEY unset or wrongCheck the key at https://suite.friendli.ai/
Model not foundThe roster changed since 2026-09-06Pick a current id from the authenticated /serverless/v1/models roster
Frequent 429sFriendli's rate limits are tightPace requests at least 20 seconds apart and retry
HTTP 422 when tools + schema are both setFriendli rejects response_format when tools is presentNeuroLink retries automatically without response_format (same handling as Groq)
Empty content at a small maxTokenszai-org/GLM-5.3 spends its budget on reasoning_content firstGive reasoning prompts a generous maxTokens budget

See also​