API Reference

Genfity AI Gateway provides a single endpoint compatible with standard chat completions (OpenAI) and Messages API (Anthropic) formats to access all AI models. Just change the base URL and use your Genfity API key.

BASE URL (OpenAI)https://ai.genfity.com/v1
BASE URL (Anthropic)https://ai.genfity.com

Quick start

Quick startcurl
curl https://ai.genfity.com/v1/models \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx"

Authentication

All requests require an API key sent via the Authorization header. Get your API key at Dashboard β†’ API Keys.

HeaderTypeDescription
Authorizationstring requiredAPI Key in Bearer <api_key> format. Get it from the dashboard.
Examplebash
curl https://ai.genfity.com/v1/chat/completions \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"genfity/claude-opus-4.7","messages":[{"role":"user","content":"Hello"}]}'

Endpoints

Send requests to any AI model through the following endpoints.

POST/v1/chat/completionsOpenAI-compatible chat completion
POST/v1/messagesAnthropic-compatible messages
POST/v1/messages/count_tokensToken count estimation
POST/v1/embeddingsVector embeddings
GET/v1/modelsList available models
POST

Create Chat Completion (OpenAI)

/v1/chat/completions

Send an OpenAI-compatible chat completion request to any AI model in the Genfity catalog.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.
Content-Typestring requiredMust be application/json.

Request Body

modelstring requiredModel ID from catalog. See /v1/models.
messagesarray requiredArray of message objects with role and content.
streamboolean Enable SSE streaming. Default false.
max_tokensinteger Maximum output tokens.
temperaturenumber Sampling temperature (0-2).
top_pnumber Nucleus sampling (0-1).
toolsarray OpenAI-format tool calling definitions.
response_formatobject Output format, e.g. { type: json_object }.
Requestcurl
curl -X POST https://ai.genfity.com/v1/chat/completions \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "genfity/claude-opus-4.7",
    "messages": [
      { "role": "user", "content": "Apa ibukota Indonesia?" }
    ],
    "temperature": 0.7,
    "max_tokens": 256,
    "stream": false
  }'
Responsejson
{
  "id": "chatcmpl_01Hxx...",
  "object": "chat.completion",
  "created": 1778803200,
  "model": "genfity/claude-opus-4.7",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Ibukota Indonesia adalah Jakarta."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 8,
    "total_tokens": 22
  }
}
POST

Anthropic Messages

/v1/messages

Send an Anthropic-compatible request to any AI model. Suitable for Claude SDKs and tools requiring Messages API.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.
Content-Typestring requiredMust be application/json.

Request Body

modelstring requiredModel ID from catalog.
max_tokensinteger requiredMaximum output tokens.
messagesarray requiredArray of messages with role and content.
systemstring System prompt (optional).
streamboolean Enable SSE streaming.
toolsarray Tool definitions with input_schema.
tool_choiceobject Control which tool is called.
Requestcurl
curl -X POST https://ai.genfity.com/v1/messages \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "genfity/claude-opus-4.7",
    "max_tokens": 1024,
    "messages": [
      { "role": "user", "content": "Hello Genfity" }
    ]
  }'
Responsejson
{
  "id": "msg_01Hxx...",
  "type": "message",
  "role": "assistant",
  "model": "genfity/claude-opus-4.7",
  "content": [
    { "type": "text", "text": "Hello! How can I help you today?" }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 25,
    "output_tokens": 12
  }
}
POST

Count Tokens

/v1/messages/count_tokens

Estimate the number of tokens in a prompt before sending a generation request.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.

Request Body

modelstring requiredModel ID from catalog.
messagesarray requiredMessages to count.
Requestcurl
curl -X POST https://ai.genfity.com/v1/messages/count_tokens \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "genfity/claude-opus-4.7",
    "messages": [{"role":"user","content":"Count this text"}]
  }'
Responsejson
{
  "input_tokens": 12
}
POST

Embeddings

/v1/embeddings

Generate vector embeddings from input text. Only available for embedding models in the catalog.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.

Request Body

modelstring requiredEmbedding model ID from catalog.
inputstring | array requiredText or array of texts to embed.
Requestcurl
curl -X POST https://ai.genfity.com/v1/embeddings \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "genfity/claude-opus-4.7",
    "input": "Genfity AI Gateway makes AI integration simple."
  }'
Responsejson
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0023, -0.0091, 0.0042, ...]
    }
  ],
  "model": "genfity/claude-opus-4.7",
  "usage": { "prompt_tokens": 8, "total_tokens": 8 }
}
POST

Image Generation

/v1/images/generations

Generate images from text prompts using image generation models like GPT Image, FLUX, Stable Diffusion, and more.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.
Content-Typestring requiredMust be application/json.

Request Body

modelstring requiredImage model ID, e.g. openai/gpt-image-2, together/black-forest-labs/FLUX.2-pro, flux-kontext.
promptstring requiredDescription of the image to generate.
ninteger Number of images (default 1).
sizestring Image size, e.g. 1024x1024, 1024x1792.
qualitystring Quality: standard or hd.
response_formatstring Output format: url or b64_json.
Requestcurl
curl -X POST https://ai.genfity.com/v1/images/generations \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "prompt": "A beautiful sunset over Indonesian rice terraces",
    "n": 1,
    "size": "1024x1024"
  }'
Responsejson
{
  "created": 1778803200,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A beautiful sunset over Indonesian rice terraces"
    }
  ]
}
GET

List Models

/v1/models

Get a list of all models available to your account.

Headers

Authorizationstring requiredAPI Key in Bearer <api_key> format.
Requestcurl
curl https://ai.genfity.com/v1/models \
  -H "Authorization: Bearer genfity_xxxxxxxxxxxx"
Responsejson
{
  "object": "list",
  "data": [
    { "id": "genfity/claude-opus-4.7", "object": "model", "owned_by": "genfity" }
  ]
}

Model & Pricing

Supported models and pricing per 1M tokens. Data is fetched directly from the active catalog database.

Loading models from database...

Error Codes

Genfity AI Gateway uses standard HTTP status codes.

CodeMessageMeaning
400invalid_jsonBody is not valid JSON.
400missing_modelModel field is empty.
400model_not_allowedModel not found or inactive in catalog.
400max_tokens_requiredPAYG/credit requires max_tokens limit.
401missing_api_keyAuthorization header is empty.
401invalid_api_key_formatHeader is not a Bearer token.
401invalid_api_keyKey is invalid or revoked.
402no_active_subscriptionKey has no active subscription.
402subscription_not_covering_modelPlan does not cover this model.
402credit_cost_not_configuredModel has no credit cost configured.
402payg_price_not_configuredModel has no PAYG price configured.
402insufficient_credit_balanceInsufficient credit balance.
402insufficient_balanceInsufficient balance.
403forbiddenNo access to this model.
429rate_limit_exceededRPM/TPM/concurrency limit exceeded.
429quota_exceededPeriod token quota exhausted.
429global_rate_limit_exceededIP burst guard exceeded.
500internal_errorInternal gateway error.
502router_unavailableThe model/provider is under high traffic. Try again later.
502upstream_errorThe model/provider is under high traffic. Try again later.
502all_candidates_failedThe model/provider is under high traffic. Try again later.
503service_unavailableService is under maintenance.

Rate Limits

Request limits are set per API key from Dashboard β†’ API Keys. When limits are exceeded, the API returns 429 Too Many Requests.

Per-key limits
  • β€’ rate_limit_per_min β€” Requests per minute per key
  • β€’ quota_tokens_monthly β€” Monthly token quota
  • β€’ concurrent_limit β€” Concurrent requests
Global IP guard
  • β€’ Window: 1 minute
  • β€’ Scope: IP + endpoint path
  • β€’ Error: global_rate_limit_exceeded

IDE & Editor

Genfity AI Gateway uses OpenAI-compatible and Anthropic-compatible formats, so almost any IDE, CLI, or SDK that supports custom base URLs works out of the box. Just change the base URL and use your Dashboard API key.

Cline

Autonomous coding agent for VS Code

Cline supports OpenAI Compatible providers. Fill in base URL, API key, and model ID in the Settings panel.

Setup
  1. 1Install the Cline extension from VS Code Marketplace.
  2. 2Open the Cline panel (left sidebar), click the Settings icon.
  3. 3API Provider β†’ choose OpenAI Compatible.
  4. 4Fill the fields according to the snippet, click Done.
https://cline.bot
Clineini
API Provider   = OpenAI Compatible
Base URL       = https://ai.genfity.com/v1
API Key        = genfity_xxxxxxxxxxxx
Model ID       = genfity/claude-opus-4.7

Roo Code

Cline fork with multi-mode agents

Roo Code (Cline fork) uses the same configuration β€” choose OpenAI Compatible then fill the Genfity base URL and key.

Setup
  1. 1Install the Roo Code extension from VS Code Marketplace.
  2. 2Open the Roo Code panel, click Settings or profile name.
  3. 3API Provider: OpenAI Compatible (not OpenAI).
  4. 4Save the profile, pick a mode (Code/Architect/Ask) and start prompting.
https://roocode.com
Roo Codeini
API Provider   = OpenAI Compatible
Base URL       = https://ai.genfity.com/v1
API Key        = genfity_xxxxxxxxxxxx
Model ID       = genfity/claude-opus-4.7

Continue.dev

Autopilot for VS Code & JetBrains

Continue uses ~/.continue/config.yaml to declare providers. Add an openai-compatible entry with the Genfity apiBase.

Setup
  1. 1Install the Continue extension in VS Code / JetBrains.
  2. 2Open ~/.continue/config.yaml (Continue: Open Config).
  3. 3Add a Genfity model under the models key.
  4. 4Reload β€” the model will appear in Continue's chat dropdown.
https://continue.dev
Continue.devyaml
models:
  - name: Genfity Claude Opus
    provider: openai
    model: genfity/claude-opus-4.7
    apiBase: https://ai.genfity.com/v1
    apiKey: genfity_xxxxxxxxxxxx
    roles:
      - chat
      - edit
      - apply

Cursor

AI-native code editor

Cursor supports Override OpenAI Base URL at Settings β†’ Models. Enable OpenAI API Key, then point base URL to Genfity.

Setup
  1. 1Cursor Settings β†’ Models β†’ scroll to OpenAI API Key.
  2. 2Enter API key: genfity_xxxxxxxxxxxx.
  3. 3Expand section β†’ enable Override OpenAI Base URL.
  4. 4Set base URL: https://ai.genfity.com/v1. Click Verify.
  5. 5Enable only models available in the Genfity catalog.
https://cursor.com
Cursorini
OpenAI API Key           = genfity_xxxxxxxxxxxx
Override Base URL        = https://ai.genfity.com/v1
Enabled Models           = genfity/claude-opus-4.7, ...

Windsurf (Codeium)

Agentic IDE by Codeium

Windsurf Cascade supports custom model endpoints. Add an OpenAI-compatible provider via Settings β†’ Cascade β†’ Add Custom Model.

Setup
  1. 1Settings (Cmd/Ctrl + ,) β†’ Cascade β†’ Models.
  2. 2Add Custom Model β†’ choose OpenAI protocol.
  3. 3Fill Base URL + Genfity API Key + Model ID.
  4. 4Enable the new model and start a Cascade session.
https://windsurf.com
Windsurf (Codeium)ini
Protocol     = OpenAI
Endpoint     = https://ai.genfity.com/v1
API Key      = genfity_xxxxxxxxxxxx
Model ID     = genfity/claude-opus-4.7
Display Name = Genfity Claude Opus

Zed

High-performance collaborative editor

Zed supports OpenAI API Compatible providers via settings.json. Add Genfity as a custom provider, then store the API key through Agent Panel settings.

Setup
  1. 1Zed β†’ Cmd/Ctrl + , β†’ open settings.json.
  2. 2Add the language_models.openai_compatible key as in the snippet.
  3. 3Open Agent Panel settings (Cmd/Ctrl + Shift + P β†’ agent: open settings).
  4. 4Find the "Genfity AI Gateway" provider, paste your API key, press Enter.
  5. 5Select a Genfity model from the Agent Panel model dropdown.
https://zed.dev
Zedjson
{
  "language_models": {
    "openai_compatible": {
      "Genfity AI Gateway": {
        "api_url": "https://ai.genfity.com/v1",
        "available_models": [
          {
            "name": "genfity/auto",
            "display_name": "Genfity Auto (Combo)",
            "max_tokens": 200000,
            "capabilities": {
              "tools": true,
              "images": true
            }
          },
          {
            "name": "genfity/claude-opus-4.7",
            "display_name": "Genfity Claude Opus 4.7",
            "max_tokens": 200000,
            "capabilities": {
              "tools": true,
              "images": true
            }
          },
          {
            "name": "genfity/claude-haiku-4.5",
            "display_name": "Genfity Claude Haiku 4.5",
            "max_tokens": 200000,
            "capabilities": {
              "tools": true,
              "images": true
            }
          }
        ]
      }
    }
  },
  "agent": {
    "default_model": {
      "provider": "openai_compatible",
      "model": "genfity/auto"
    }
  }
}

Kilo Code

Open-source AI agent for VS Code

Kilo Code supports OpenAI Compatible providers. Fill in the Genfity base URL, API key, and model ID in the Settings panel.

Setup
  1. 1Install the Kilo Code extension from VS Code Marketplace.
  2. 2Open the Kilo Code panel β†’ Settings.
  3. 3API Provider β†’ choose OpenAI Compatible.
  4. 4Fill Base URL + API Key + Model, click Save then Done.
https://kilocode.ai
Kilo Codeini
API Provider   = OpenAI Compatible
Base URL       = https://ai.genfity.com/v1
API Key        = genfity_xxxxxxxxxxxx
Model          = genfity/claude-opus-4.7

TRAE

ByteDance AI-native IDE

TRAE can add custom OpenAI-compatible models. Use the OpenAI protocol with the Genfity base URL and key.

Setup
  1. 1Open Settings (icon at top-right of the chat) β†’ Models.
  2. 2Click + Add Model β†’ choose the OpenAI Compatible protocol/provider.
  3. 3Fill Base URL = https://ai.genfity.com/v1, API Key, and Model = genfity/claude-opus-4.7.
  4. 4Click Add Model then select it in the chat.
https://trae.ai
TRAEini
Provider   = OpenAI Compatible
Base URL   = https://ai.genfity.com/v1
API Key    = genfity_xxxxxxxxxxxx
Model      = genfity/claude-opus-4.7

Xcode

Apple's IDE with Coding Intelligence

Xcode 26+ supports Internet Hosted model providers. Use the Genfity host with an Authorization: Bearer header.

Setup
  1. 1Xcode β†’ Settings β†’ Intelligence β†’ Add a Model Provider.
  2. 2Choose the Internet Hosted tab.
  3. 3URL = https://ai.genfity.com (bare host, no /v1). API Key Header = Authorization.
  4. 4API Key = Bearer genfity_xxxxxxxxxxxx (the word Bearer, a space, then the key).
  5. 5Click Add, enable genfity/claude-opus-4.7, press Cmd+0 to start.
https://developer.apple.com/xcode/
Xcodeini
URL             = https://ai.genfity.com
API Key Header  = Authorization
API Key         = Bearer genfity_xxxxxxxxxxxx
Description      = Genfity AI Gateway
Model            = genfity/claude-opus-4.7

CLI & Terminal

Genfity AI Gateway uses OpenAI-compatible and Anthropic-compatible formats, so almost any IDE, CLI, or SDK that supports custom base URLs works out of the box. Just change the base URL and use your Dashboard API key.

Claude Code

Anthropic's official CLI

Claude Code uses the Anthropic-compatible endpoint. The most stable setup is an env block in ~/.claude/settings.json (not one-off exports). Clear any old ANTHROPIC_AUTH_TOKEN & ANTHROPIC_BASE_URL first β€” env vars override settings.json.

Prerequisites: Node.js 18+. On Windows prefer WSL or Git for Windows; on macOS use nvm (avoid a direct package install to dodge permission issues).
Setup
  1. 1IMPORTANT β€” clear old env: environment variables override settings.json. macOS/Linux: unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL then delete the export lines in ~/.bashrc or ~/.zshrc. Windows PowerShell: [Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL',$null,'User').
  2. 2Edit or create ~/.claude/settings.json (Windows: C:\Users\<user>\.claude\settings.json) with the env block in the Configuration panel.
  3. 3(Optional) Skip Anthropic login: set "hasCompletedOnboarding": true in ~/.claude.json so it won't try to reach api.anthropic.com.
  4. 4Open a NEW terminal (so config is read), cd into the project, run claude, choose Trust This Folder. Confirm with /status that ANTHROPIC_BASE_URL points to Genfity.
https://claude.com/claude-code
Install
bash
npm install -g @anthropic-ai/claude-code
claude --version
Configuration
Claude Codejson
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://ai.genfity.com",
    "ANTHROPIC_AUTH_TOKEN": "genfity_xxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "genfity/claude-opus-4.7",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "genfity/claude-opus-4.7",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "genfity/claude-opus-4.7",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "genfity/claude-haiku-4.5",
    "ANTHROPIC_SMALL_FAST_MODEL": "genfity/claude-haiku-4.5",
    "API_TIMEOUT_MS": "3000000"
  }
}

opencode

AI coding agent in your terminal (SST)

opencode is an open-source TUI-based coding agent. Add Genfity as an OpenAI-compatible provider.

Setup
  1. 1Create ~/.config/opencode/opencode.json (global) or opencode.json at project root (Windows: %USERPROFILE%\.config\opencode\opencode.json).
  2. 2Set the API key as env GENFITY_KEY. macOS/Linux: export GENFITY_KEY="KEY" in ~/.zshrc/~/.bashrc. Windows PowerShell: [Environment]::SetEnvironmentVariable('GENFITY_KEY','KEY','User').
  3. 3Run opencode in your terminal, pick the Genfity provider from the model list.
https://opencode.ai
Install
bash
curl -fsSL https://opencode.ai/install | bash
Configuration
opencodejson
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "genfity": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Genfity",
      "options": {
        "baseURL": "https://ai.genfity.com/v1",
        "apiKey": "{env:GENFITY_KEY}"
      },
      "models": {
        "genfity/claude-opus-4.7": { "name": "Claude Opus 4.7" }
      }
    }
  }
}

Codex CLI

OpenAI Codex CLI agent

Codex CLI supports OpenAI-compatible providers via ~/.codex/config.toml. The Genfity gateway serves Chat/Completions, so wire_api = "chat" is required β€” the latest Codex defaults to the Responses API, which the gateway does not serve.

Prerequisites: Node.js 18+. The Genfity gateway only serves Chat/Completions, so wire_api = "chat" is REQUIRED β€” the latest Codex defaults to the unsupported Responses API.
Setup
  1. 1Set the API key as the GENFITY_KEY environment variable (see the Set API key panel).
  2. 2Edit ~/.codex/config.toml (Windows: C:\Users\<user>\.codex\config.toml) β€” add the block in the Configuration panel. wire_api = "chat" is REQUIRED.
  3. 3If the latest Codex throws "wire_api = chat is no longer supported", downgrade: npm install -g @openai/[email protected].
  4. 4Restart Codex, then run codex at the project root (model & provider are read from config automatically).
https://github.com/openai/codex
Install
bash
npm i -g @openai/codex
codex --version
Configuration
Codex CLItoml
model = "genfity/claude-opus-4.7"
model_provider = "genfity"
model_context_window = 200000

[model_providers.genfity]
name = "Genfity"
base_url = "https://ai.genfity.com/v1"
env_key = "GENFITY_KEY"
wire_api = "chat"
Set API key (GENFITY_KEY)
Set API key (GENFITY_KEY)bash
# macOS / Linux (zsh)
echo 'export GENFITY_KEY="genfity_xxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc

# Windows PowerShell
[Environment]::SetEnvironmentVariable('GENFITY_KEY','genfity_xxxxxxxxxxxx','User')

Windows: open a new PowerShell after setting the env var so it's picked up.

Aider

AI pair programming in your terminal

Aider reads OpenAI-style environment variables. Override OPENAI_API_BASE and OPENAI_API_KEY for Genfity.

Prerequisites: Python 3.8+. The openai/ model prefix is required so Aider routes to the OpenAI-compatible endpoint.
Setup
  1. 1Set OpenAI-style env (see the Configuration panel). Or put them in .aider.conf.yml / .env. Windows PowerShell: [Environment]::SetEnvironmentVariable('OPENAI_API_BASE','...','User') and the same for OPENAI_API_KEY.
  2. 2Run from project root: aider --model openai/genfity/claude-opus-4.7.
https://aider.chat
Install
bash
pipx install aider-chat
Configuration
Aiderbash
export OPENAI_API_BASE="https://ai.genfity.com/v1"
export OPENAI_API_KEY="genfity_xxxxxxxxxxxx"

aider --model openai/genfity/claude-opus-4.7

LLM (Simon Willison)

Versatile CLI + Python library for any LLM

LLM CLI uses the llm-openai-plugin for OpenAI-compatible providers. Register Genfity as a new model.

Prerequisites: Python 3.8+.
Setup
  1. 1Save API key: llm keys set genfity then paste genfity_xxxxxxxxxxxx.
  2. 2Find the config dir: dirname "$(llm logs path)". Edit extra-openai-models.yaml there (create it if missing) as in the Configuration panel.
  3. 3Test: llm -m genfity/claude-opus 'hello'.
https://llm.datasette.io
Install
bash
pipx install llm
llm install llm-openai-plugin
Configuration
LLM (Simon Willison)yaml
- model_id: genfity/claude-opus
  model_name: genfity/claude-opus-4.7
  api_base: "https://ai.genfity.com/v1"
  api_key_name: genfity
  can_stream: true

Goose

Block's agentic CLI + desktop

Goose supports Anthropic Compatible providers. Point the Base URL to the Genfity Anthropic endpoint (without /v1).

Setup
  1. 1Open Goose β†’ Create New Provider β†’ choose Anthropic Compatible.
  2. 2Fill Base URL = https://ai.genfity.com (no /v1), API Key = genfity_xxxxxxxxxxxx, Model = genfity/claude-opus-4.7.
  3. 3Save, then Switch Models on the main screen and pick the Genfity provider.
https://block.github.io/goose/
Install
bash
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
Configuration
Gooseini
Provider  = Anthropic Compatible
Base URL  = https://ai.genfity.com
API Key   = genfity_xxxxxxxxxxxx
Model     = genfity/claude-opus-4.7

Crush

Charm's terminal coding agent (CLI + TUI)

Crush uses ~/.config/crush/crush.json to declare OpenAI-compatible providers. Add Genfity under the providers key.

Setup
  1. 1Edit ~/.config/crush/crush.json (Windows: %USERPROFILE%\.config\crush\crush.json). Create the folder if missing.
  2. 2Add the providers.genfity block as in the Configuration panel.
  3. 3Restart crush, press Ctrl+P β†’ Switch Model β†’ pick a Genfity model.
https://github.com/charmbracelet/crush
Install
bash
brew install charmbracelet/tap/crush
Configuration
Crushjson
{
  "providers": {
    "genfity": {
      "id": "genfity",
      "name": "Genfity AI Gateway",
      "base_url": "https://ai.genfity.com/v1",
      "type": "openai",
      "api_key": "genfity_xxxxxxxxxxxx",
      "models": [
        { "id": "genfity/claude-opus-4.7", "name": "Genfity Claude Opus 4.7" }
      ]
    }
  }
}

Droid (Factory)

Factory's terminal coding agent

Droid uses ~/.factory/config.json for custom models. Use the anthropic provider with the Genfity base URL.

Prerequisites: Clear ANTHROPIC_AUTH_TOKEN β€” it overrides api_key in config.json. macOS/Linux: unset ANTHROPIC_AUTH_TOKEN. Windows PowerShell: [Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN',$null,'User').
Setup
  1. 1Edit ~/.factory/config.json (not settings.json; Windows: C:\Users\<user>\.factory\config.json) β€” add the custom_models entry from the Configuration panel.
  2. 2Run droid, type /model then pick Genfity.
https://factory.ai
Install
bash
curl -fsSL https://app.factory.ai/cli | sh
Configuration
Droid (Factory)json
{
  "custom_models": [
    {
      "model_display_name": "Genfity Claude Opus 4.7",
      "model": "genfity/claude-opus-4.7",
      "base_url": "https://ai.genfity.com",
      "api_key": "genfity_xxxxxxxxxxxx",
      "provider": "anthropic",
      "max_tokens": 64000
    }
  ]
}

Qwen Code

Alibaba's terminal coding agent

Qwen Code reads OpenAI-style environment variables. Override OPENAI_BASE_URL, OPENAI_API_KEY, and OPENAI_MODEL for Genfity.

Prerequisites: Node.js 20+.
Setup
  1. 1Set OpenAI-style env (see the Configuration panel). Windows PowerShell: [Environment]::SetEnvironmentVariable('OPENAI_BASE_URL','...','User') and the same for OPENAI_API_KEY / OPENAI_MODEL.
  2. 2Open a new terminal, run qwen at the project root. If prompted for a provider, pick OpenAI-compatible and confirm the model ID.
https://github.com/QwenLM/qwen-code
Install
bash
npm i -g @qwen-code/qwen-code
Configuration
Qwen Codebash
export OPENAI_BASE_URL="https://ai.genfity.com/v1"
export OPENAI_API_KEY="genfity_xxxxxxxxxxxx"
export OPENAI_MODEL="genfity/claude-opus-4.7"

qwen

Grok CLI

Terminal agent (OpenAI-compatible)

Grok CLI uses GROK_BASE_URL and GROK_API_KEY. Point them at the Genfity OpenAI-compatible endpoint.

Prerequisites: Node.js 18+. Clear OPENAI_API_KEY & OPENAI_BASE_URL to avoid clashes. macOS/Linux: unset OPENAI_API_KEY OPENAI_BASE_URL. Windows PowerShell: [Environment]::SetEnvironmentVariable('OPENAI_API_KEY',$null,'User').
Setup
  1. 1Set Grok env (see the Configuration panel). Windows PowerShell: [Environment]::SetEnvironmentVariable('GROK_BASE_URL','...','User') and the same for GROK_API_KEY.
  2. 2Open a new terminal, run grok --model genfity/claude-opus-4.7.
https://github.com/superagent-ai/grok-cli
Install
bash
npm i -g @vibe-kit/grok-cli
Configuration
Grok CLIbash
export GROK_BASE_URL="https://ai.genfity.com/v1"
export GROK_API_KEY="genfity_xxxxxxxxxxxx"

grok --model genfity/claude-opus-4.7

OpenHands

Open-source AI software agent

OpenHands uses the openai/ prefix for OpenAI-compatible endpoints. Set llm_base_url to Genfity.

Prerequisites: Python 3.12+. The model MUST carry the openai/ prefix. On Windows use WSL.
Setup
  1. 1Configure the LLM via env (LLM_MODEL/LLM_BASE_URL/LLM_API_KEY) or config.toml β€” see the Configuration panel.
  2. 2Run openhands then open the UI at http://localhost:3000.
https://github.com/All-Hands-AI/OpenHands
Install
bash
pipx install openhands
Configuration
OpenHandsini
llm_model="openai/genfity/claude-opus-4.7"
llm_base_url="https://ai.genfity.com/v1"
llm_api_key="genfity_xxxxxxxxxxxx"

openhands

OpenClaw

Open-source personal AI assistant (WA/Telegram/Discord)

OpenClaw uses an anthropic-messages provider in ~/.openclaw/openclaw.json. Register Genfity as a provider then restart the gateway.

Prerequisites: Node.js 22.19+. auth.mode none is single-machine local only; for remote access run openclaw doctor --fix.
Setup
  1. 1Run the wizard: openclaw onboard. For the provider choose Skip for now (registered manually next).
  2. 2Edit ~/.openclaw/openclaw.json (Windows: %USERPROFILE%\.openclaw\openclaw.json) β€” add the genfity provider from the Configuration panel. Use mode: merge to keep other config safe; don't replace the whole file.
  3. 3Set agents.defaults.model.primary to genfity/claude-opus-4.7.
  4. 4Apply: openclaw gateway restart. WhatsApp/Telegram/Discord channels are configured separately after the gateway is up.
https://openclaw.ai
Install
bash
curl -fsSL https://openclaw.ai/install.sh | bash
Configuration
OpenClawjson
{
  "models": {
    "mode": "merge",
    "providers": {
      "genfity": {
        "baseUrl": "https://ai.genfity.com",
        "apiKey": "genfity_xxxxxxxxxxxx",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "genfity/claude-opus-4.7",
            "name": "Genfity Claude Opus 4.7",
            "input": ["text", "image"],
            "contextWindow": 200000,
            "maxTokens": 64000
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": { "primary": "genfity/claude-opus-4.7" }
    }
  }
}

Desktop & Web UI

Genfity AI Gateway uses OpenAI-compatible and Anthropic-compatible formats, so almost any IDE, CLI, or SDK that supports custom base URLs works out of the box. Just change the base URL and use your Dashboard API key.

LibreChat

Self-hosted multi-model chat UI

LibreChat uses librechat.yaml to register custom endpoints. Add Genfity as a custom endpoint.

Setup
  1. 1Copy librechat.example.yaml β†’ librechat.yaml (deploy root).
  2. 2Add the endpoints.custom block as shown.
  3. 3Set GENFITY_KEY in .env (mounted to the container).
  4. 4Restart the container: docker compose up -d.
https://librechat.ai
LibreChatyaml
version: 1.0.9
endpoints:
  custom:
    - name: "Genfity"
      apiKey: "${GENFITY_KEY}"
      baseURL: "https://ai.genfity.com/v1"
      models:
        default: ["genfity/claude-opus-4.7"]
        fetch: true
      titleModel: "genfity/claude-haiku-4.5"
      summarize: false
      forcePrompt: false

Open WebUI

Extensible ChatGPT-style web UI

Open WebUI can add multiple OpenAI-compatible connections in Admin Settings.

Setup
  1. 1Sign in as admin β†’ Admin Panel β†’ Settings β†’ Connections.
  2. 2OpenAI API β†’ click + to add a new connection.
  3. 3Fill: API Base URL = https://ai.genfity.com/v1, API Key = genfity_xxxxxxxxxxxx.
  4. 4Save β†’ Genfity models appear in the Workspace dropdown.
https://openwebui.com
Open WebUIini
API Base URL = https://ai.genfity.com/v1
API Key      = genfity_xxxxxxxxxxxx
Prefix ID    = genfity (optional)

Chatbox

Cross-platform desktop AI client

Chatbox supports a custom OpenAI host. Open Settings β†’ AI Model β†’ choose OpenAI API and fill the Genfity host + key.

Setup
  1. 1Download Chatbox (macOS/Windows/Linux) or use the web version.
  2. 2Settings β†’ Model β†’ AI Provider = OpenAI API.
  3. 3Fill API Key + API Host = https://ai.genfity.com/v1.
  4. 4Choose Model = genfity/claude-opus-4.7 β†’ Save.
https://chatboxai.app
Chatboxini
AI Provider = OpenAI API
API Key     = genfity_xxxxxxxxxxxx
API Host    = https://ai.genfity.com/v1
Model       = genfity/claude-opus-4.7

Jan

Offline-first personal AI

Jan supports remote providers via Settings β†’ Model Providers β†’ OpenAI.

Setup
  1. 1Settings β†’ Model Providers β†’ OpenAI.
  2. 2Fill API Key = genfity_xxxxxxxxxxxx, Base URL = https://ai.genfity.com/v1.
  3. 3Models tab β†’ import a model with ID genfity/claude-opus-4.7.
  4. 4Start a new thread and pick the Genfity model.
https://jan.ai
Janini
Provider  = OpenAI (compatible)
Base URL  = https://ai.genfity.com/v1
API Key   = genfity_xxxxxxxxxxxx
Model ID  = genfity/claude-opus-4.7

LM Studio

Desktop UI for local + remote LLMs

LM Studio supports remote OpenAI-compatible endpoints via the Connect to a server feature.

Setup
  1. 1LM Studio β†’ Chat icon β†’ click Select a model.
  2. 2Dropdown β†’ Server settings β†’ Add remote endpoint.
  3. 3Base URL = https://ai.genfity.com/v1, API Key = genfity_xxxxxxxxxxxx.
  4. 4Click Load β†’ choose genfity/claude-opus-4.7.
https://lmstudio.ai
LM Studioini
Base URL = https://ai.genfity.com/v1
API Key  = genfity_xxxxxxxxxxxx
Model    = genfity/claude-opus-4.7

Cherry Studio

Multi-provider desktop AI client

Cherry Studio can add custom OpenAI-compatible providers. Fill the Genfity API host + key, then add the model.

Setup
  1. 1Settings β†’ Model Providers β†’ Add Provider β†’ choose the OpenAI type.
  2. 2Fill API Host = https://ai.genfity.com/v1, API Key = genfity_xxxxxxxxxxxx.
  3. 3Click Check to verify, then Add Model = genfity/claude-opus-4.7.
  4. 4Pick the Genfity model in the chat dropdown.
https://cherry-ai.com
Cherry Studioini
Provider  = OpenAI (compatible)
API Host  = https://ai.genfity.com/v1
API Key   = genfity_xxxxxxxxxxxx
Model     = genfity/claude-opus-4.7

SDK & Framework

Genfity AI Gateway uses OpenAI-compatible and Anthropic-compatible formats, so almost any IDE, CLI, or SDK that supports custom base URLs works out of the box. Just change the base URL and use your Dashboard API key.

OpenAI Python SDK

Official Python client

The OpenAI Python SDK accepts a base_url argument. Just change the base URL and API key.

Setup
  1. 1Install: pip install openai.
  2. 2Instantiate the client with the Genfity base URL.
  3. 3Call chat.completions.create(...) as usual.
https://github.com/openai/openai-python
OpenAI Python SDKpython
from openai import OpenAI

client = OpenAI(
    api_key="genfity_xxxxxxxxxxxx",
    base_url="https://ai.genfity.com/v1",
)

res = client.chat.completions.create(
    model="genfity/claude-opus-4.7",
    messages=[{"role": "user", "content": "Hello Genfity"}],
)
print(res.choices[0].message.content)

OpenAI Node SDK

Official TypeScript / Node client

The OpenAI Node SDK accepts a baseURL on instantiation. Fully compatible with Genfity chat completions.

Setup
  1. 1Install: npm i openai.
  2. 2Set GENFITY_KEY env var, then use as in the snippet.
https://github.com/openai/openai-node
OpenAI Node SDKtypescript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.GENFITY_KEY,
  baseURL: "https://ai.genfity.com/v1",
});

const res = await client.chat.completions.create({
  model: "genfity/claude-opus-4.7",
  messages: [{ role: "user", content: "Hello Genfity" }],
});
console.log(res.choices[0].message.content);

Anthropic Python SDK

Official Anthropic Python client

The Anthropic Python SDK accepts a base_url argument. Use the Genfity /v1/messages endpoint.

Setup
  1. 1Install: pip install anthropic.
  2. 2Instantiate the client with the Genfity base URL (without /v1).
  3. 3Call messages.create(...) as usual.
https://github.com/anthropics/anthropic-sdk-python
Anthropic Python SDKpython
import anthropic

client = anthropic.Anthropic(
    api_key="genfity_xxxxxxxxxxxx",
    base_url="https://ai.genfity.com",
)

message = client.messages.create(
    model="genfity/claude-opus-4.7",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello Genfity"}],
)
print(message.content[0].text)

Anthropic Node SDK

Official Anthropic TypeScript client

The Anthropic Node SDK accepts a baseURL on instantiation. Use the Genfity /v1/messages endpoint.

Setup
  1. 1Install: npm i @anthropic-ai/sdk.
  2. 2Instantiate the client with the Genfity base URL (without /v1).
  3. 3Call messages.create(...) as usual.
https://github.com/anthropics/anthropic-sdk-typescript
Anthropic Node SDKtypescript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.GENFITY_KEY,
  baseURL: "https://ai.genfity.com",
});

const message = await client.messages.create({
  model: "genfity/claude-opus-4.7",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello Genfity" }],
});
console.log(message.content[0].text);

LangChain

LLM orchestration framework

Use ChatOpenAI with the Genfity base_url β€” pattern is identical to OpenAI direct.

Setup
  1. 1Install: pip install langchain-openai.
  2. 2Instantiate ChatOpenAI with base_url + api_key.
https://python.langchain.com
LangChainpython
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="genfity/claude-opus-4.7",
    api_key="genfity_xxxxxxxxxxxx",
    base_url="https://ai.genfity.com/v1",
    temperature=0.2,
)

print(llm.invoke("Hello Genfity").content)

Vercel AI SDK

TypeScript toolkit for AI apps

Use @ai-sdk/openai with the createOpenAI({ baseURL }) helper.

Setup
  1. 1Install: npm i ai @ai-sdk/openai.
  2. 2Call createOpenAI with the Genfity baseURL.
https://sdk.vercel.ai
Vercel AI SDKtypescript
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const genfity = createOpenAI({
  apiKey: process.env.GENFITY_KEY!,
  baseURL: "https://ai.genfity.com/v1",
});

const { text } = await generateText({
  model: genfity("genfity/claude-opus-4.7"),
  prompt: "Hello Genfity",
});
console.log(text);

Laravel (PHP)

PHP HTTP client integration

Use Http::withToken to send requests to Genfity AI Gateway from Laravel.

Setup
  1. 1Set GENFITY_KEY in .env.
  2. 2Use Illuminate\Support\Facades\Http for POST requests.
  3. 3Parse the response with ->json().
https://laravel.com
Laravel (PHP)php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('GENFITY_KEY'))
    ->post('https://ai.genfity.com/v1/chat/completions', [
        'model' => 'genfity/claude-opus-4.7',
        'messages' => [
            ['role' => 'user', 'content' => 'Hello Genfity'],
        ],
    ]);

return $response->json();

Schedule a Project Discussion Now!

Schedule a call with our team and discover how digitization can be your strongest asset.

Consult Now
Genfity Teams