Connect an API client
Use the local connection address, protocol, and credential for a named profile.
On this page
Point the client at Runir
Use the local connection address for the signed-in user. The port can differ between users and devices. Choose the named profile whose protocol matches the client. The client authenticates to Runir with the dedicated local Gateway token. The profile supplies the separate upstream credential.
Run the configuration helper to generate local settings for an OpenAI-format client.
python3 scripts/gateway.py client openai
Review the generated base URL and credential reference. Apply them to the intended client’s configuration. You can also launch a child process with the required OpenAI environment variables.
python3 scripts/gateway.py run openai -- python3 your_ai_script.py
Replace the script name with your approved client. For Anthropic-format clients, use the configured Anthropic profile. For Gemini, generate a native request and use the client’s supported base-URL setting.
Choose the matching request path
| Protocol | Named profile path |
|---|---|
| OpenAI-compatible | /gateway/PROFILE/v1/chat/completions or /gateway/PROFILE/v1/responses when supported upstream |
| Anthropic | /gateway/PROFILE/v1/messages or /gateway/PROFILE/v1/messages/count_tokens |
| Gemini | /gateway/PROFILE/v1beta/models/MODEL:generateContent or the streaming variant :streamGenerateContent?alt=sse |
Replace PROFILE with the local profile ID. When configuring an SDK base URL, use the generated base so the SDK can append its operation path.
Test one request
Use the helper to generate a sample request for the approved profile and model.
python3 scripts/gateway.py client openai --format curl --model YOUR_APPROVED_MODEL
Review the generated command before running it. Send harmless sample text, check the upstream response, and match the request in Companion → Recent activity. Keep the local token and provider credentials out of logs and support messages.