{"slug":"use-openai-compatible-tools-with-aperture","title":"Use OpenAI-compatible tools with Aperture","tags":["tailscale"],"agent_summary":"Last validated: Apr 9, 2026","trigger_phrases":[],"runnable":false,"markdown":"\r\n# Use OpenAI-compatible tools with Aperture\r\n\r\nLast validated: Apr 9, 2026\r\n\r\nAperture by Tailscaleis currently [in alpha](https://tailscale.com/docs/reference/tailscale-release-stages#alpha).\r\n\r\nConfigure OpenAI-compatible LLM clients to send requests through [Aperture by Tailscale](https://tailscale.com/docs/aperture). This guide covers any LLM client that supports a custom API base URL, including Gemini CLI, Roo Code, Cline, and custom applications.\r\n\r\nFor client-specific instructions, refer to the guides for [Claude Code](https://tailscale.com/docs/aperture/how-to/use-claude-code), [Codex](https://tailscale.com/docs/aperture/how-to/use-codex), and [OpenCode](https://tailscale.com/docs/aperture/how-to/use-opencode).\r\n\r\n## [Prerequisites](https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools\\#prerequisites)\r\n\r\nBefore you begin, you need:\r\n\r\n- An Aperture instance with at least one configured provider, accessible from your device. Refer to [get started with Aperture](https://tailscale.com/docs/aperture/get-started) if you have not set this up.\r\n- The Aperture host URL (default: `http://ai`) accessible from your device. Use `http://`, not `https://`.\r\n\r\nTo avoid unexpected TLS issues, use `http://` for the Aperture URL when configuring LLM clients. All connections remain encrypted using WireGuard, even when HTTPS is not used.\r\n\r\nAperture routes requests based on the model name, not the LLM client. Any LLM client configured to use Aperture can access any provider your admin has set up. Refer to the [provider compatibility reference](https://tailscale.com/docs/aperture/provider-compatibility) for the full list of supported providers and API formats.\r\n\r\n## [Configure the client](https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools\\#configure-the-client)\r\n\r\nIn your LLM client's settings, set the API base URL to your Aperture instance and provide a placeholder API key:\r\n\r\n- **API Base URL**: `http://ai/v1`\r\n- **API Key**: Leave empty or set to any value (Aperture ignores client-provided keys and injects credentials automatically)\r\n\r\nThe exact setting names vary by client. Look for fields labeled \"API Base URL,\" \"Base URL,\" \"API Endpoint,\" or similar.\r\n\r\n## [Custom applications](https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools\\#custom-applications)\r\n\r\nYou can point any HTTP client at the Aperture URL as long as it uses a [supported provider API format](https://tailscale.com/docs/aperture/provider-compatibility). For example, to send a request using the OpenAI chat completions API:\r\n\r\n```shell\r\ncurl -s http://ai/v1/chat/completions \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"model\": \"gpt-4o\",\r\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\r\n  }'\r\n```\r\n\r\nAperture routes the request to the appropriate provider based on the model name.\r\n\r\n## [Verify the connection](https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools\\#verify-the-connection)\r\n\r\n1. Send a test request using your configured tool.\r\n2. Open the Aperture dashboard at `http://ai/ui/` and confirm the request appears on the **Logs** page.\r\n\r\nIf the request does not appear, refer to the [Aperture troubleshooting guide](https://tailscale.com/docs/aperture/troubleshooting).\r\n\r\n## [Next steps](https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools\\#next-steps)\r\n\r\n- [Grant model access to users](https://tailscale.com/docs/aperture/how-to/grant-model-access): Control which models each user or group can access through Aperture.\r\n- [View your usage dashboards](https://tailscale.com/docs/aperture/reference/dashboard): Monitor token consumption, costs, and session activity across your organization.\r\n- [Set per-user spending limits](https://tailscale.com/docs/aperture/how-to/set-per-user-spending-limits): Configure quota buckets to control costs for individual users.\r\n\r\n![Project Logo](https://cdn.brandfetch.io/tailscale.com/fallback/lettermark/theme/dark/h/256/w/256/icon?c=1bfwsmEH20zzEfSNTed)\r\n\r\nAsk AI\r\n\r\nreCAPTCHA\r\n\r\nRecaptcha requires verification.\r\n\r\nprotected by **reCAPTCHA**\r\n","html":"<h1>Use OpenAI-compatible tools with Aperture</h1>\n<p>Last validated: Apr 9, 2026</p>\n<p>Aperture by Tailscaleis currently <a href=\"https://tailscale.com/docs/reference/tailscale-release-stages#alpha\">in alpha</a>.</p>\n<p>Configure OpenAI-compatible LLM clients to send requests through <a href=\"https://tailscale.com/docs/aperture\">Aperture by Tailscale</a>. This guide covers any LLM client that supports a custom API base URL, including Gemini CLI, Roo Code, Cline, and custom applications.</p>\n<p>For client-specific instructions, refer to the guides for <a href=\"https://tailscale.com/docs/aperture/how-to/use-claude-code\">Claude Code</a>, <a href=\"https://tailscale.com/docs/aperture/how-to/use-codex\">Codex</a>, and <a href=\"https://tailscale.com/docs/aperture/how-to/use-opencode\">OpenCode</a>.</p>\n<h2><a href=\"https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools#prerequisites\">Prerequisites</a></h2>\n<p>Before you begin, you need:</p>\n<ul>\n<li>An Aperture instance with at least one configured provider, accessible from your device. Refer to <a href=\"https://tailscale.com/docs/aperture/get-started\">get started with Aperture</a> if you have not set this up.</li>\n<li>The Aperture host URL (default: <code>http://ai</code>) accessible from your device. Use <code>http://</code>, not <code>https://</code>.</li>\n</ul>\n<p>To avoid unexpected TLS issues, use <code>http://</code> for the Aperture URL when configuring LLM clients. All connections remain encrypted using WireGuard, even when HTTPS is not used.</p>\n<p>Aperture routes requests based on the model name, not the LLM client. Any LLM client configured to use Aperture can access any provider your admin has set up. Refer to the <a href=\"https://tailscale.com/docs/aperture/provider-compatibility\">provider compatibility reference</a> for the full list of supported providers and API formats.</p>\n<h2><a href=\"https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools#configure-the-client\">Configure the client</a></h2>\n<p>In your LLM client's settings, set the API base URL to your Aperture instance and provide a placeholder API key:</p>\n<ul>\n<li><strong>API Base URL</strong>: <code>http://ai/v1</code></li>\n<li><strong>API Key</strong>: Leave empty or set to any value (Aperture ignores client-provided keys and injects credentials automatically)</li>\n</ul>\n<p>The exact setting names vary by client. Look for fields labeled \"API Base URL,\" \"Base URL,\" \"API Endpoint,\" or similar.</p>\n<h2><a href=\"https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools#custom-applications\">Custom applications</a></h2>\n<p>You can point any HTTP client at the Aperture URL as long as it uses a <a href=\"https://tailscale.com/docs/aperture/provider-compatibility\">supported provider API format</a>. For example, to send a request using the OpenAI chat completions API:</p>\n<pre><code class=\"language-shell\">curl -s http://ai/v1/chat/completions \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"model\": \"gpt-4o\",\r\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\r\n  }'\n</code></pre>\n<p>Aperture routes the request to the appropriate provider based on the model name.</p>\n<h2><a href=\"https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools#verify-the-connection\">Verify the connection</a></h2>\n<ol>\n<li>Send a test request using your configured tool.</li>\n<li>Open the Aperture dashboard at <code>http://ai/ui/</code> and confirm the request appears on the <strong>Logs</strong> page.</li>\n</ol>\n<p>If the request does not appear, refer to the <a href=\"https://tailscale.com/docs/aperture/troubleshooting\">Aperture troubleshooting guide</a>.</p>\n<h2><a href=\"https://tailscale.com/docs/aperture/how-to/use-openai-compatible-tools#next-steps\">Next steps</a></h2>\n<ul>\n<li><a href=\"https://tailscale.com/docs/aperture/how-to/grant-model-access\">Grant model access to users</a>: Control which models each user or group can access through Aperture.</li>\n<li><a href=\"https://tailscale.com/docs/aperture/reference/dashboard\">View your usage dashboards</a>: Monitor token consumption, costs, and session activity across your organization.</li>\n<li><a href=\"https://tailscale.com/docs/aperture/how-to/set-per-user-spending-limits\">Set per-user spending limits</a>: Configure quota buckets to control costs for individual users.</li>\n</ul>\n<p><img src=\"https://cdn.brandfetch.io/tailscale.com/fallback/lettermark/theme/dark/h/256/w/256/icon?c=1bfwsmEH20zzEfSNTed\" alt=\"Project Logo\"></p>\n<p>Ask AI</p>\n<p>reCAPTCHA</p>\n<p>Recaptcha requires verification.</p>\n<p>protected by <strong>reCAPTCHA</strong></p>\n"}