Skip to main content

Model API

The Entrim Model API serves open-source models through an OpenAI-compatible HTTP API. Anything that already works with the OpenAI API, whether that's an SDK, a framework or a coding agent, works with Entrim once you change three things: the base URL, the API key and the model name.

Base URL​

https://api.entrim.ai/v1

Authentication​

Create an API key in the Entrim Dashboard under API Keys and send it as a bearer token with every request:

Authorization: Bearer <your-api-key>

The examples in these docs read the key from the ENTRIM_API_KEY environment variable:

export ENTRIM_API_KEY="<your-api-key>"
Keep your key secret

Anyone with your API key can spend your credits. Keep it out of source control and client-side code. If a key leaks, rotate it in the dashboard. See API keys.

Make your first request​

curl https://api.entrim.ai/v1/chat/completions \
-H "Authorization: Bearer $ENTRIM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zai-org/GLM-5.3-Flash",
"messages": [
{"role": "user", "content": "Write a haiku about the Julian Alps."}
]
}'

The response has the same shape as an OpenAI chat completion. Chat completions covers every request parameter, streaming, tool calling and images.

Endpoints​

MethodPathDescription
GET/v1/modelsList the models your API key can use
POST/v1/chat/completionsGenerate the next message in a conversation

Use Entrim in your tools​

Any tool that lets you add an OpenAI-compatible provider can use Entrim. These guides walk through the setup step by step:

  • Cline: the open-source coding agent for VS Code
  • Cursor: the AI code editor
  • GitHub Copilot: Copilot Chat in VS Code
  • opencode: the open-source coding agent for your terminal
  • Pi: the minimal, extensible terminal coding agent

Credits and usage​

Model API usage is paid from prepaid credits. You can check your credit balance and add credits under Billing, and follow your spending under Usage.