Use it from your tools
Anything that speaks the OpenAI API works with Porten. The recipe is always the same: set the base URL to https://porten.ai/v1 and the API key to your sk-porten-… key.
OpenCode
OpenCode is a terminal coding agent. Add Porten as a provider in ~/.config/opencode/opencode.jsonc:
{
"provider": {
"porten": {
"npm": "@ai-sdk/openai-compatible",
"name": "Porten",
"options": {
"baseURL": "https://porten.ai/v1",
"apiKey": "{env:PORTEN_API_KEY}"
},
"models": {
"qwen3-coder-next": { "name": "Qwen3-Coder-Next" },
"qwen2.5-coder-32b": { "name": "Qwen2.5 Coder 32B" }
}
}
}
}
Then select a porten/… model in OpenCode. Because models load on demand, the first turn against a cold model takes longer while the fleet provisions it — the request simply waits rather than failing.
Cursor
In Settings → Models, enable Override OpenAI Base URL, set it to https://porten.ai/v1, and paste your key. Add the model id (e.g. qwen2.5-coder-32b) under custom models. Cursor will route chat through Porten.
Continue (VS Code / JetBrains)
In ~/.continue/config.json:
{
"models": [
{
"title": "Porten — Qwen Coder",
"provider": "openai",
"model": "qwen2.5-coder-32b",
"apiBase": "https://porten.ai/v1",
"apiKey": "sk-porten-…"
}
]
}
LangChain (Python)
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="qwen2.5-coder-32b",
base_url="https://porten.ai/v1",
api_key="sk-porten-…",
)
print(llm.invoke("Summarize the CAP theorem in two sentences.").content)
LlamaIndex (Python)
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="qwen2.5-coder-32b",
api_base="https://porten.ai/v1",
api_key="sk-porten-…",
is_chat_model=True,
)
Anything else
If your tool has an "OpenAI-compatible" or "custom OpenAI endpoint" option, use it. Set:
- Base URL / API base:
https://porten.ai/v1 - API key:
sk-porten-… - Model: any id from
GET /v1/models
Tip: if a tool sends a model id the catalog doesn't recognize, you'll get a
404 model_not_found. List the models first and copy the exact canonical id.
https://porten.ai/docs/integrations.md — or grab the
whole site via llms.txt / llms-full.txt.