Coding agents
Connect FunkyRouter to a coding agent with one copy-paste prompt.
Paste this prompt into your coding agent, for example Claude Code, Cursor or OpenCode. The agent then sets up FunkyRouter in your project. The prompt does not contain your key. The agent reads the key from the FUNKYROUTER_API_KEY environment variable.
Prompts for each agent
The connect step in the app writes this prompt for the agent that you select. It also gives a one-command setup for Pi. Go to Connect your agent.
Copy-paste prompt
Set me up to use FunkyRouter, an OpenAI-compatible inference API. Its nodes run in Texas facilities that are confirmed at node enrollment. A Texas-only network path is not verified.
FunkyRouter does not store or log prompts or completions. It keeps usage metadata, such as token counts and timing.
- Base URL: https://api.funkyrouter.ai/v1
- API key: read it from the FUNKYROUTER_API_KEY environment variable. I already have the key. Never print, log, or commit it.
- Model: cabeza-latest
- Limits: 1,048,576-token context window, shared by prompt and output. Set the client's maximum output to 32,768 tokens. Without a maximum, a request reserves credit for the rest of the window. Turn on streaming. Without streaming, the prompt can have at most 131,072 tokens.
- Supported: POST /chat/completions with streaming and tool calling (OpenAI `tools` format, `tool_choice` "auto" or "none"), and POST /responses without tools. Input is text and images. Send images as base64 data URLs, not remote URLs. Output is text. Embeddings and image generation are not available.
- The API returns HTTP 400 for request fields it does not support (for example `store`, `reasoning_effort`, `prompt_cache_key`, `stop`, or a `developer` role message in chat completions). Turn those client options off.
Do this:
1. Ask me to export FUNKYROUTER_API_KEY in my shell, then check that it is set without echoing its value.
2. If this project already uses an OpenAI client or SDK, point it at the base URL, key, and model above.
3. If I have no agent harness yet, FunkyRouter recommends Pi Durable (https://github.com/earendil-works/pi/tree/main/packages/durable). Read its README, install it, and register FunkyRouter as a custom OpenAI-compatible provider.
4. Send one short chat completion, one that calls a simple tool, and one with a small PNG image. Show me the three replies and the token usage.
Docs: https://funkyrouter.ai/docsClient settings
Many clients send extra fields to providers that they do not know. FunkyRouter returns HTTP 400 for these fields. Set your client as follows:
- Use the Chat Completions API (
openai-completionsorchat) when your agent calls tools. The Responses API does not support tools. - Turn off
store,reasoning_effort, prompt cache keys and strict tool schemas. - Send
max_completion_tokensormax_tokens, not both. Set the maximum output to 32,768 tokens. Always set it. A request without a maximum output reserves credit for the remainder of the window. - Turn on streaming. Without streaming, the prompt can have at most 131,072 tokens. A long answer can also time out.
- Send images as base64 data URLs. Each side must be 40 to 4,096 pixels. See Images.
- Send system instructions with the
systemrole, not thedeveloperrole. - Set the context window to 1,048,576 tokens.
Last updated on