Guide · LiteLLM

Connect LiteLLM to Synap

3 steps · about 2 minutes

  1. Get a free key

    Sign in with Google at synap.linkrra.com — no card. Your key starts with sk-pool-.

  2. Call it from Python

    The openai/ prefix selects the OpenAI-compatible transport; what follows it is the Synap model id.

    # pip install litellm
    import os
    from litellm import completion
    
    r = completion(
        model="openai/qwen3-coder-30b",
        api_base="https://synap.linkrra.com/v1",
        api_key=os.environ["SYNAP_API_KEY"],
        messages=[{"role": "user", "content": "Write a haiku about diffs"}],
    )
    print(r.choices[0].message.content)
  3. Or put it behind the proxy

    One entry in config.yaml, and every OpenAI client in your stack can reach Synap through the gateway. The proxy will not start without a master key of its own.

    # config.yaml
    model_list:
      - model_name: qwen3-coder-30b
        litellm_params:
          model: openai/qwen3-coder-30b
          api_base: https://synap.linkrra.com/v1
          api_key: os.environ/SYNAP_API_KEY
    # pip install 'litellm[proxy]'
    export SYNAP_API_KEY=sk-pool-...
    export LITELLM_MASTER_KEY=sk-$(openssl rand -hex 32)
    litellm --config config.yaml --port 4000
    
    curl http://127.0.0.1:4000/v1/chat/completions \
      -H "authorization: Bearer $LITELLM_MASTER_KEY" \
      -H 'content-type: application/json' \
      -d '{"model":"qwen3-coder-30b","messages":[{"role":"user","content":"Say OK"}]}'
Notes, prices and limits

The openai/ prefix, as the SDK or behind the proxy. Recommended model: qwen3-coder-30b — $0.0675 in and $0.27 out per 1M tokens, 98,304-token context.

Run live against this API with litellm 1.106.6, both ways: the SDK call, and a real completion fetched through a locally started proxy.

litellm 1.106.6 refuses to start the proxy with no master key set — it exits and tells you to set LITELLM_MASTER_KEY (or general_settings.master_key). That is the key the proxy’s own callers present; your sk-pool- key stays in the config and is never handed to them.

Keeping model_name equal to the Synap model id means callers learn nothing new. A different name maps fine too — litellm_params.model is what reaches us.

On the free tier: every request counts input and output against 100,000 free tokens a day, and answers stop at 4,096 output tokens. Coding agents send long prompts, so the free tier covers a short session; credits cover the rest.

Field names from LiteLLM docs: OpenAI-compatible endpoints, run against this API, checked 2026-11-03 17:45 UTC. Prices refresh from /v1/models when this page loads.