Sweet API Config Generator

Generate Configuration Script

Enter your Sweet API key and pick a model. The generated PowerShell script will configure Codex, Opencode, or any OpenAI-compatible client to use your Sweet API endpoint.

# Enter your API key and choose a model, then click Generate
Scripts updated!

FAQ & Instructions

What is Sweet API? ?

Sweet API is an OpenAI-compatible API proxy that routes requests to various LLM models via HuggingFace. It supports the same request format as OpenAI, so any tool that works with OpenAI can work with Sweet API by changing the base URL and API key.

Base URL: https://api.sweet-vpn.ru/v1

How do I get an API key? ?

Go to admin.sweet-vpn.ru and sign in with your admin credentials. Click "Create API Key" — you can set a name and optional expiration. Copy the key immediately — it won't be shown again.

You can also click Load From Admin above to fetch your keys directly.

How to configure Codex CLI? ?

Run the generated PowerShell script (or equivalent) to set environment variables:

$env:OPENAI_API_KEY = "sk-..."
$env:OPENAI_BASE_URL = "https://api.sweet-vpn.ru/v1"

For permanent configuration, add these to your PowerShell profile ($PROFILE) or set them as system environment variables.

Codex will now use Sweet API for all AI requests. No other changes needed — it's fully OpenAI-compatible.

How to configure Opencode (VS Code)? ?

Opencode in VS Code uses the same environment variables as Codex. Run the Opencode tab's PowerShell script, then restart VS Code.

Alternatively, configure in VS Code settings:

"opencode.apiKey": "sk-..."
"opencode.baseUrl": "https://api.sweet-vpn.ru/v1"

Which models are available? ?

Sweet API routes to 9 models via HuggingFace:

qwen deepseek-v4-pro command-r7b glm-4-7 gpt-oss-120b llama-3.3-70b llama-3.1-8b-nscale llama-3.1-8b-scaleway apertus-8b

Each model is backed by a different provider — choose based on your needs for speed, quality, or context length.

How do I test my key? ?

PowerShell:

Invoke-RestMethod -Uri "https://api.sweet-vpn.ru/v1/responses" -Method Post -Headers @{{Authorization="Bearer sk-YOUR_KEY"}} -Body '{{"model":"qwen","messages":[{{"role":"user","content":"Hello"}}]}}' | Select-Object -ExpandProperty content

cURL:

curl -X POST https://api.sweet-vpn.ru/v1/responses -H "Authorization: Bearer sk-YOUR_KEY" -H "Content-Type: application/json" -d '{{"model":"qwen","messages":[{{"role":"user","content":"Hello"}}]}}'

Is streaming supported? ?

Yes! Add "stream": true to your request body. The API returns SSE (Server-Sent Events) with token-by-token output. All clients shown on this page support streaming — it's enabled automatically in the generated scripts.

Rate limits & pricing? ?

Rate limit: 60 requests per minute per API key. Currently, all models are free via HuggingFace routing — no usage costs. This may change in the future.

Check your usage stats at admin.sweet-vpn.ru.