Skip to content

Integration guide

LiteLLM Proxy & Python SDK Setup Guide (litellm_config.yaml)

Route LiteLLM Proxy and the Python litellm.completion() SDK through ProxyStacks Relay (https://proxystacks.com/v1) using RELAY_API_KEY to unify Funsion (-50% Claude 5.5 benchmark), GPT-6.1 Sol (-30%), DeepSeek V4.1 Flash ($0.18/1M), GLM-5.3, and Kimi K3.1 Pro under one prepaid USD balance.

Setup

  1. 1

    Create a Relay API key (sk-relay-...) in the console and export RELAY_API_KEY in the environment running LiteLLM.

  2. 2

    Add model entries to litellm_config.yaml using model: openai/<model_id> and api_base: https://proxystacks.com/v1 (or https://hk.proxystacks.com/v1 in APAC).

  3. 3

    Start the proxy with litellm --config litellm_config.yaml and call any configured model name from downstream services.

Configuration

deepseek-v4.1-flash
litellm_config.yaml
model_list:
  - model_name: deepseek-v4.1-flash
    litellm_params:
      model: openai/deepseek-v4.1-flash
      api_base: https://proxystacks.com/v1
      api_key: os.environ/RELAY_API_KEY

Prefix model IDs with openai/ in litellm_config.yaml and set api_key: os.environ/RELAY_API_KEY for clean OpenAI-compatible forwarding.

Advanced config: environment variable API key, multi-model routing & max output tokens

Use a project-specific config or multi-profile setup with environment variable keys, flagship and fast models — Funsion Opus/Sonnet 5.5 (-50%), GPT-6.1 Sol / GPT-6 Luna (-30%), DeepSeek V4.1 Flash (-40%), GLM-5.3 & Kimi K3.1 Pro (-30%) — and explicit context/output token limits.

litellm_config.yaml (multi-model router)
model_list:
  # LiteLLM Proxy multi-route config (CN low-latency edge: https://hk.proxystacks.com/v1)
  - model_name: funsion-sonnet-5-5
    litellm_params:
      model: openai/funsion-sonnet-5-5
      api_base: https://proxystacks.com/v1
      api_key: os.environ/RELAY_API_KEY
  - model_name: gpt-6.1-sol
    litellm_params:
      model: openai/gpt-6.1-sol
      api_base: https://proxystacks.com/v1
      api_key: os.environ/RELAY_API_KEY
  - model_name: deepseek-v4.1-flash
    litellm_params:
      model: openai/deepseek-v4.1-flash
      api_base: https://proxystacks.com/v1
      api_key: os.environ/RELAY_API_KEY
  - model_name: glm-5.3
    litellm_params:
      model: openai/glm-5.3
      api_base: https://proxystacks.com/v1
      api_key: os.environ/RELAY_API_KEY

router_settings:
  routing_strategy: simple-shuffle
  num_retries: 2

Troubleshooting

  • 401: check the Relay key and authentication header. Never paste a secret into a support ticket.
  • 404: use an exact published model ID and the documented base URL, not an upstream alias.
  • For streaming use stream: true. Codex uses Responses; keep disable_response_storage = true.

Common questions

Why does Cursor's Verify button fail after setting Override OpenAI Base URL?

When you click Verify in Cursor Settings → Models, Cursor tests whichever model toggles are currently active. First save https://proxystacks.com/v1 under Override OpenAI Base URL and paste your sk-relay-... key, then add funsion-sonnet-5-5 or deepseek-v4.1-flash via + Add model and turn off unused default OpenAI model switches before clicking Verify.

Which custom model IDs should I add in Cursor for Agent, Composer, and fast edits?

Add funsion-sonnet-5-5 (50% off Claude 5.5 benchmark) for daily multi-file Agent & Composer work, gpt-6.1-sol (-30%) for complex architecture and debugging, glm-5.3 ($0.98/1M input) for 1M-token repository context, and deepseek-v4.1-flash ($0.18/1M input) for fast inline edits — all billed from one prepaid balance (starting from US$10).

Does Override OpenAI Base URL break Cursor Tab autocomplete or .cursor/mcp.json servers?

No. Cursor Tab uses Cursor's dedicated completion service independently of your OpenAI Base URL override, and MCP servers configured in .cursor/mcp.json continue to expose local or remote tools to funsion-sonnet-5-5 and gpt-6.1-sol in Agent mode.

All docs