SDKs and AI tools
Almost every SDK and AI tool supports OpenAI- or Anthropic-compatible APIs. Fill in three things: base URL, API key, and model ID.
Three settings
| Setting | Value |
|---|---|
| Base URL | https://api.markas.ai.id/v1 for the OpenAI format. https://api.markas.ai.id (without /v1) for the Anthropic format. |
| API key | An mt-... key from the dashboard. |
| Model | An id from the Models page or GET /v1/models. |
Also set the output token limit and context window in the tool to match the model's max_output_tokens and context_length. Tools that send no max_tokens make the balance hold use the model limit, so a small balance can be rejected with 402.
SDKs and frameworks
| SDK | Setting |
|---|---|
| OpenAI Python | OpenAI(base_url="https://api.markas.ai.id/v1", api_key=...) |
| OpenAI Node.js | new OpenAI({ baseURL: "https://api.markas.ai.id/v1", apiKey }) |
| Anthropic Python | anthropic.Anthropic(base_url="https://api.markas.ai.id", api_key=...) |
| Anthropic Node.js | new Anthropic({ baseURL: "https://api.markas.ai.id", apiKey }) |
| LangChain (Python) | ChatOpenAI(model="MODEL_ID", base_url="https://api.markas.ai.id/v1", api_key=...) |
| LangChain.js | new ChatOpenAI({ model: "MODEL_ID", apiKey, configuration: { baseURL: "https://api.markas.ai.id/v1" } }) |
| LlamaIndex | OpenAILike(model="MODEL_ID", api_base="https://api.markas.ai.id/v1", api_key=..., is_chat_model=True) |
| Vercel AI SDK | createOpenAICompatible({ name: "markasai", baseURL: "https://api.markas.ai.id/v1", apiKey }) |
Many tools read the standard OpenAI SDK environment variables:
export OPENAI_BASE_URL="https://api.markas.ai.id/v1"
export OPENAI_API_KEY="$MARKASAI_API_KEY"
AI tools for developers
| Tool | Format | Notes |
|---|---|---|
| Cursor | OpenAI | Override OpenAI Base URL in Settings, Models. Chat and Agent use MarkasAI models; Tab stays on Cursor's model. |
| Claude Code | Anthropic | Unofficial: built for Claude models. See the environment variables below. |
| Codex CLI | Responses | Custom provider in ~/.codex/config.toml with wire_api = "responses". |
| Cline, Roo Code, Kilo Code | OpenAI | Pick the OpenAI Compatible provider. |
| Continue, OpenCode, Zed | OpenAI | OpenAI provider with a custom base URL in the tool's config file. |
| Aider | OpenAI | OPENAI_API_BASE and OPENAI_API_KEY variables, model with the openai/ prefix. |
| Open WebUI | OpenAI | Add an OpenAI connection in the Connections menu. |
| OpenClaw, Hermes Agent | OpenAI or Anthropic | Custom provider in the tool's config file. |
Claude Code
export ANTHROPIC_BASE_URL="https://api.markas.ai.id"
export ANTHROPIC_AUTH_TOKEN="$MARKASAI_API_KEY"
export ANTHROPIC_MODEL="MODEL_ID"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="SMALL_MODEL_ID"
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
claude
Codex CLI
model = "MODEL_ID"
model_provider = "markasai"
[model_providers.markasai]
name = "MarkasAI"
base_url = "https://api.markas.ai.id/v1"
env_key = "MARKASAI_API_KEY"
wire_api = "responses"
If Codex does not know the model ID, add model_context_window and model_max_output_tokens from /v1/models to the provider block.
Common symptoms
| Symptom | Cause and fix |
|---|---|
404 on /v1/v1/... | Anthropic tools append /v1 themselves. Use the base URL without /v1. |
404 on /chat/completions | The OpenAI base URL is missing /v1. |
The tool rejects the key (expects sk-...) | Use an OpenAI Compatible option or a custom provider that does not check the key prefix. |
| CORS or Failed to fetch in a web app | Browser calls are unsupported. Call from your server. |
| The stream stops midway | A proxy, VPN, or antivirus is buffering SSE. Turn buffering off, or try without streaming. |