---
name: offmem
description: Configure the coding agent you are running in to use offmem, a censorship-free and private AI API compatible with the OpenAI and Anthropic formats.
---

# offmem

Set up offmem as the model provider of the agent the user is running right now.

- OpenAI format base URL: https://api.offmem.app/v1
- Anthropic format base URL: https://api.offmem.app
- API key: starts with `om_`, read from the `OFFMEM_API_KEY` environment variable
- Main model: `offmem-glm-5.3-sem-censura`
- Fast model (titles, summaries, small tasks): `offmem-glm-5.3-flash-sem-censura`
- All models: `offmem-glm-5.3-flash-sem-censura`, `offmem-deepseek-v4.1-flash-sem-censura`, `offmem-glm-5.3-sem-censura`, `offmem-kimi-k3.1-pro`, `offmem-minimax-m3.1-flash`, `offmem-deepseek-v4.1-flash-fast`

## Steps

1. Check whether `OFFMEM_API_KEY` is set. If it is not, ask the user to create a key at https://console.offmem.app/chaves and save it with the command for their system. Never print the key, never write it to the chat, never commit it.

   macOS: `echo 'export OFFMEM_API_KEY="om_..."' >> ~/.zshrc && source ~/.zshrc`
   Linux: `echo 'export OFFMEM_API_KEY="om_..."' >> ~/.bashrc && source ~/.bashrc`
   Windows: `setx OFFMEM_API_KEY "om_..."`

2. Test the key before touching any config:

   ```bash
   curl https://api.offmem.app/v1/chat/completions \
     -H "Authorization: Bearer $OFFMEM_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"model": "offmem-glm-5.3-flash-sem-censura", "messages": [{"role": "user", "content": "ok"}]}'
   ```

   Windows (PowerShell):

   ```powershell
   Invoke-RestMethod -Method Post -Uri https://api.offmem.app/v1/chat/completions `
     -Headers @{ Authorization = "Bearer $env:OFFMEM_API_KEY" } `
     -ContentType "application/json" `
     -Body '{"model": "offmem-glm-5.3-flash-sem-censura", "messages": [{"role": "user", "content": "ok"}]}'
   ```

3. Identify which agent you are and apply only its section below. Back up any file before editing it and merge, never overwrite existing settings.
4. Tell the user what changed and how to confirm it works.

## Agents

### OpenCode

API format: OpenAI. Official docs: https://opencode.ai/docs/providers/#custom-provider

Create or edit ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\opencode.json), merging this content without deleting what is already there:

```jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "offmem": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "offmem",
      "options": {
        "baseURL": "https://api.offmem.app/v1",
        "apiKey": "{env:OFFMEM_API_KEY}"
      },
      "models": {
        "offmem-glm-5.3-flash-sem-censura": {
          "name": "GLM 5.3 Flash"
        },
        "offmem-deepseek-v4.1-flash-sem-censura": {
          "name": "DeepSeek V4.1 Flash"
        },
        "offmem-glm-5.3-sem-censura": {
          "name": "GLM 5.3"
        },
        "offmem-kimi-k3.1-pro": {
          "name": "Kimi K3.1 Pro"
        },
        "offmem-minimax-m3.1-flash": {
          "name": "MiniMax M3.1 Flash"
        },
        "offmem-deepseek-v4.1-flash-fast": {
          "name": "DeepSeek V4.1 Flash Fast"
        }
      }
    }
  },
  "model": "offmem/offmem-glm-5.3-sem-censura",
  "small_model": "offmem/offmem-glm-5.3-flash-sem-censura"
}
```

Then: Open OpenCode, type /models and pick "GLM 5.3" from the offmem provider.

### Claude Code

API format: Anthropic. Official docs: https://code.claude.com/docs/en/llm-gateway-connect

Create or edit ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json), merging this content without deleting what is already there:

```jsonc
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.offmem.app",
    "ANTHROPIC_AUTH_TOKEN": "COLE_SUA_CHAVE_AQUI",
    "ANTHROPIC_MODEL": "offmem-glm-5.3-sem-censura",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "offmem-glm-5.3-sem-censura",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "offmem-glm-5.3-sem-censura",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "offmem-glm-5.3-flash-sem-censura",
    "CLAUDE_CODE_SUBAGENT_MODEL": "offmem-glm-5.3-sem-censura",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "200000"
  }
}
```

Replace COLE_SUA_CHAVE_AQUI with the value of the OFFMEM_API_KEY environment variable (this file does not read variables).

Then: Reopen Claude Code and run /status: "Anthropic base URL" should show the offmem address.

### OpenClaw

API format: OpenAI. Official docs: https://docs.openclaw.ai

Create or edit ~/.openclaw/openclaw.json, merging this content without deleting what is already there:

```jsonc
{
  agents: {
    defaults: {
      model: { primary: "offmem/offmem-glm-5.3-sem-censura" },
    },
  },
  models: {
    mode: "merge",
    providers: {
      offmem: {
        baseUrl: "https://api.offmem.app/v1",
        apiKey: "${OFFMEM_API_KEY}",
        api: "openai-completions",
        models: [
          { id: "offmem-glm-5.3-flash-sem-censura", name: "GLM 5.3 Flash" },
          { id: "offmem-deepseek-v4.1-flash-sem-censura", name: "DeepSeek V4.1 Flash" },
          { id: "offmem-glm-5.3-sem-censura", name: "GLM 5.3" },
          { id: "offmem-kimi-k3.1-pro", name: "Kimi K3.1 Pro" },
          { id: "offmem-minimax-m3.1-flash", name: "MiniMax M3.1 Flash" },
          { id: "offmem-deepseek-v4.1-flash-fast", name: "DeepSeek V4.1 Flash Fast" },
        ],
      },
    },
  },
}
```

Then: Restart OpenClaw and send "ok" to test.

### Hermes Agent

API format: OpenAI. Official docs: https://hermes-agent.nousresearch.com

Create or edit ~/.hermes/config.yaml, merging this content without deleting what is already there:

```yaml
model:
  default: offmem-glm-5.3-sem-censura
  provider: custom
  base_url: https://api.offmem.app/v1
  key_env: OFFMEM_API_KEY
```

Back up config.yaml first. If Hermes cannot see the variable, put it in ~/.hermes/.env. If key_env is not accepted, tell me instead of saving the key in the config.

Then: Restart the session and send "ok" to test.

### Pi

API format: OpenAI. Official docs: https://pi.dev

Create or edit ~/.pi/agent/models.json, merging this content without deleting what is already there:

```jsonc
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "offmem": {
      "name": "offmem",
      "baseUrl": "https://api.offmem.app/v1",
      "api": "openai-completions",
      "apiKey": "$OFFMEM_API_KEY",
      "models": [
        {
          "id": "offmem-glm-5.3-flash-sem-censura",
          "name": "GLM 5.3 Flash"
        },
        {
          "id": "offmem-deepseek-v4.1-flash-sem-censura",
          "name": "DeepSeek V4.1 Flash"
        },
        {
          "id": "offmem-glm-5.3-sem-censura",
          "name": "GLM 5.3"
        },
        {
          "id": "offmem-kimi-k3.1-pro",
          "name": "Kimi K3.1 Pro"
        },
        {
          "id": "offmem-minimax-m3.1-flash",
          "name": "MiniMax M3.1 Flash"
        },
        {
          "id": "offmem-deepseek-v4.1-flash-fast",
          "name": "DeepSeek V4.1 Flash Fast"
        }
      ]
    }
  }
}
```

Create or edit ~/.pi/agent/settings.json, merging this content without deleting what is already there:

```jsonc
{
  "defaultProvider": "offmem",
  "defaultModel": "offmem-glm-5.3-sem-censura"
}
```

Then: Run /reload, pick the model with /model and send "ok" to test.

### DeepSeek Harness

API format: OpenAI. Official docs: https://github.com/deepseek-ai/deepseek-harness

Create or edit ~/.dsh/profiles/<profile>/cordis.patch.yml, merging this content without deleting what is already there:

```yaml
- name: '@deepseek-ai/dsh-llm-pi-ai'
  config:
    providers:
      offmem:
        displayName: offmem
        apiKeyEnv: OFFMEM_API_KEY
        api: openai-completions
        baseURL: https://api.offmem.app/v1
        models:
          - id: offmem-glm-5.3-flash-sem-censura
            name: GLM 5.3 Flash
          - id: offmem-deepseek-v4.1-flash-sem-censura
            name: DeepSeek V4.1 Flash
          - id: offmem-glm-5.3-sem-censura
            name: GLM 5.3
          - id: offmem-kimi-k3.1-pro
            name: Kimi K3.1 Pro
          - id: offmem-minimax-m3.1-flash
            name: MiniMax M3.1 Flash
          - id: offmem-deepseek-v4.1-flash-fast
            name: DeepSeek V4.1 Flash Fast
- name: '@deepseek-ai/dsh-agent-default-model'
  config:
    provider: offmem
    model: offmem-glm-5.3-sem-censura
```

Then: Validate with "dsh --profile <profile> --dump-config", restart dsh and send "ok".

### OpenBot

API format: OpenAI. Official docs: https://github.com/CopilotKit/OpenBot

Create or edit .env (OpenBot root), merging this content without deleting what is already there:

```bash
OPENAI_BASE_URL=https://api.offmem.app/v1
OPENAI_API_KEY=COLE_SUA_CHAVE_AQUI
COPILOTKIT_OPENAI_API=chat
BOT_MODEL=offmem-glm-5.3-sem-censura
```

Create or edit model.yaml (tenant package), merging this content without deleting what is already there:

```yaml
provider: openai
credential_secret_ref: openai-api-key
default_model: offmem-glm-5.3-sem-censura
```

Replace COLE_SUA_CHAVE_AQUI with the value of the OFFMEM_API_KEY variable and do not delete the CopilotKit key.

Then: Restart with scripts/start.sh and send "ok" to a Bot.

### Cline, Roo Code, Cursor

API format: OpenAI.

"OpenAI Compatible" provider:

```
Base URL: https://api.offmem.app/v1
API key:  om_...
Model ID: offmem-glm-5.3-sem-censura
```

## Links

- Site: https://info.offmem.app
- API keys and balance: https://console.offmem.app/chaves
- Docs: https://docs.offmem.app
