Contents

Agents and editors

Region

Any tool that speaks the OpenAI or Anthropic API works. Give it three things.

base urlhttps://au.api.safeailabs.ai/v1
keysail_… in SAFE_AI_KEY
modeldeepseek-flash

Keep /v1 on the base URL unless a tool adds it. Where a tool asks for a context window, use 128000.

Claude Code · Codex CLI · OpenCode · Pi · OpenClaw · Hermes Agent · Aider · Zed · Cursor · Cline, Roo Code, Kilo Code · Continue · Vercel AI SDK · OpenAI Agents SDK · LangChain · LiteLLM · n8n · Not yet

Claude Code

Claude Code sends the Anthropic Messages API and adds /v1/messages itself, so the base URL has no /v1. Set the variables in ~/.claude/settings.json or your shell.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://au.api.safeailabs.ai",
    "ANTHROPIC_AUTH_TOKEN": "sail_…",
    "ANTHROPIC_MODEL": "deepseek-flash",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-flash"
  }
}

Codex CLI

Codex sends the Responses API. Add a provider to ~/.codex/config.toml. Project-level files cannot set providers.

~/.codex/config.toml
model = "deepseek-flash"
model_provider = "safeailabs"

[model_providers.safeailabs]
name = "Safe AI Labs"
base_url = "https://au.api.safeailabs.ai/v1"
env_key = "SAFE_AI_KEY"
wire_api = "responses"

OpenCode

Add a provider to opencode.json in the project, or ~/.config/opencode/opencode.json for every project.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "safeailabs": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Safe AI Labs",
      "options": {
        "baseURL": "https://au.api.safeailabs.ai/v1",
        "apiKey": "{env:SAFE_AI_KEY}"
      },
      "models": {
        "deepseek-flash": { "name": "DeepSeek Flash", "limit": { "context": 128000, "output": 16384 } }
      }
    }
  },
  "model": "safeailabs/deepseek-flash"
}

Pi

Add a provider to ~/.pi/agent/models.json. Pi reloads it when you open /model.

~/.pi/agent/models.json
{
  "providers": {
    "safeailabs": {
      "baseUrl": "https://au.api.safeailabs.ai/v1",
      "api": "openai-completions",
      "apiKey": "$SAFE_AI_KEY",
      "models": [{ "id": "deepseek-flash", "name": "DeepSeek Flash" }]
    }
  }
}

Run pi --model safeailabs/deepseek-flash, or pick it in /model and save it as the default.

OpenClaw

Formerly Clawdbot. Add a provider to ~/.openclaw/openclaw.json and set it as the primary model.

~/.openclaw/openclaw.json
{
  agents: { defaults: { model: { primary: "safeailabs/deepseek-flash" } } },
  models: {
    providers: {
      safeailabs: {
        baseUrl: "https://au.api.safeailabs.ai/v1",
        apiKey: "${SAFE_AI_KEY}",
        api: "openai-completions",
        models: [{ id: "deepseek-flash", name: "DeepSeek Flash" }],
      },
    },
  },
}

Or from the shell: openclaw models set safeailabs/deepseek-flash.

Hermes Agent

Point the model block in ~/.hermes/config.yaml at your region. The key goes in ~/.hermes/.env.

~/.hermes/config.yaml
model:
  default: deepseek-flash
  provider: custom
  base_url: https://au.api.safeailabs.ai/v1
  api_key: ${SAFE_AI_KEY}

Or run hermes model and choose the custom endpoint.

Aider

Two environment variables and a model prefixed openai/.

Shell
export OPENAI_API_BASE=https://au.api.safeailabs.ai/v1
export OPENAI_API_KEY=$SAFE_AI_KEY
aider --model openai/deepseek-flash

Zed

Add the provider in settings.json. Enter the key in the provider's settings panel, or set SAFEAILABS_API_KEY. Zed does not read keys from settings.

settings.json
{
  "language_models": {
    "openai_compatible": {
      "safeailabs": {
        "api_url": "https://au.api.safeailabs.ai/v1",
        "available_models": [
          { "name": "deepseek-flash", "display_name": "DeepSeek Flash", "max_tokens": 128000 }
        ]
      }
    }
  }
}

Cursor

Settings, Models, API Keys. Turn on OpenAI API Key and paste your key. Turn on Override OpenAI Base URL and enter the base URL. Add a custom model named deepseek-flash.

Cursor sends the request from its own servers, so the request does not leave from your machine. The override applies to every model while it is on, and Tab keeps using Cursor's models.

Cline, Roo Code, Kilo Code

Choose the OpenAI Compatible provider in the extension settings and enter three fields.

base urlhttps://au.api.safeailabs.ai/v1
api keysail_…
model iddeepseek-flash

Set the context window to 128000 in the model configuration. Kilo Code also reads ~/.config/kilo/kilo.jsonc, in the same shape as OpenCode.

Continue

Add a model to ~/.continue/config.yaml. Put the key in ~/.continue/.env; the extension does not read your shell.

~/.continue/config.yaml
models:
  - name: DeepSeek Flash
    provider: openai
    model: deepseek-flash
    apiBase: https://au.api.safeailabs.ai/v1
    apiKey: ${{ secrets.SAFE_AI_KEY }}
    roles: [chat, edit, apply]
    capabilities: [tool_use]

Vercel AI SDK

The OpenAI-compatible provider sends chat completions. The plain OpenAI provider works too and sends the Responses API.

pnpm add ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const safeailabs = createOpenAICompatible({
  name: "safeailabs",
  baseURL: "https://au.api.safeailabs.ai/v1",
  apiKey: process.env.SAFE_AI_KEY,
});

const { text } = await generateText({
  model: safeailabs("deepseek-flash"),
  prompt: "Hello",
});

OpenAI Agents SDK

Set a default client. Turn tracing off unless you also have an OpenAI key.

import os
from openai import AsyncOpenAI
from agents import Agent, Runner, set_default_openai_client, set_tracing_disabled

client = AsyncOpenAI(
    base_url="https://au.api.safeailabs.ai/v1",
    api_key=os.environ["SAFE_AI_KEY"],
)
set_default_openai_client(client, use_for_tracing=False)
set_tracing_disabled(True)

agent = Agent(name="Assistant", instructions="Be brief.", model="deepseek-flash")
result = Runner.run_sync(agent, "Hello")
print(result.final_output)

LangChain

Python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="deepseek-flash",
    base_url="https://au.api.safeailabs.ai/v1",
    api_key=os.environ["SAFE_AI_KEY"],
)

LiteLLM

Prefix the model with openai/. Works in the SDK and in the proxy config.

import litellm

r = litellm.completion(
    model="openai/deepseek-flash",
    api_base="https://au.api.safeailabs.ai/v1",
    api_key=os.environ["SAFE_AI_KEY"],
    messages=[{"role": "user", "content": "Hello"}],
)

n8n

Create an OpenAI credential with your key and the base URL. In the OpenAI Chat Model node, choose the model by ID and enter deepseek-flash.

credentialOpenAI
api keysail_…
base urlhttps://au.api.safeailabs.ai/v1

Not yet

Gemini CLI sends only the Gemini API, which is not served. See Compatibility for what is.

Back toQuickstart