Deploy on Unkey

When buyers ask AI, does it say your name?

See when ChatGPT, Google and Claude recommend you, and who they pick instead.

Open source · Self-hosted · MIT licensed

Asked in ChatGPT appApp answer

Where should a small team deploy a public API in 2026?

It depends on your stack, but three providers come up again and again.

  1. AWS for API Gateway, Lambda and every region under one contract.#1, named instead
  2. Unkey for API keys, rate limits and compute in one place.you, #2 · linked
  3. Fly.io for long-running containers close to your users.#3
Linked: unkey.com, aws.amazon.com, github.comunder $0.01

Every question your buyers ask.

Check #8 for Unkey, with example data: each question in each AI app.
QuestionChatGPT appGoogle AI OverviewPerplexity appCodex CLIClaude CodeOpus 5.5Claude CodeSonnet 5.5Named
1Where should a small team deploy a public API in 2026?
ChatGPT app: named #1Google AI Overview: named #1Perplexity app: named #2Codex CLI: named #2Claude Code Opus 5.5: named #2Claude Code Sonnet 5.5: named #26 of 6
2What is the easiest way to add API keys and rate limits to an existing API?
ChatGPT app: named #2Google AI Overview: named #1Perplexity app: named #1Codex CLI: named #2Claude Code Opus 5.5: named #1Claude Code Sonnet 5.5: named #46 of 6
3Which API platform has the most predictable pricing for a startup?
ChatGPT app: not namedGoogle AI Overview: named #2Perplexity app: named #3Codex CLI: named #1Claude Code Opus 5.5: named #3Claude Code Sonnet 5.5: named #45 of 6
4How do I move an API off a single VPS without downtime?
ChatGPT app: named #2Google AI Overview: named #3Perplexity app: named #2Codex CLI: named #1Claude Code Opus 5.5: named #1Claude Code Sonnet 5.5: named #16 of 6
5What are good alternatives to running my own API gateway?
ChatGPT app: named #3Google AI Overview: named #2Perplexity app: named #5Codex CLI: named #3Claude Code Opus 5.5: named #1Claude Code Sonnet 5.5: named #16 of 6
6Which platform is best for hosting a Postgres-backed API close to European users?
ChatGPT app: not namedGoogle AI Overview: not namedPerplexity app: linked, not namedCodex CLI: not namedClaude Code Opus 5.5: linked, not namedClaude Code Sonnet 5.5: not named0 of 6
named, at position 2 linked, not named named someone elseCheck #8 · Unkey, example data · 29 of 36 named

Know the day you drop out.

Check #6 · ChatGPT appApp answer

Which API platform has the most predictable pricing for a startup?

  1. AWS
  2. Unkeyyou, #2 · linked
  3. Cloudflare
  4. Fly.io
  5. Zuplo
Linked: unkey.com and 3 moreunder $0.01
Check #7 · ChatGPT appApp answer

Which API platform has the most predictable pricing for a startup?

  1. Fly.ionamed first
  2. Cloudflare
  3. Zuplo
  4. AWS

Unkey: not named, and unkey.com no longer linked

Linked: fly.io and 3 moreunder $0.01
BynameNotification

Check #7: 1 gained, 6 lost

Named in 24 of 36 answers.

Since check #6: 1 gained, 6 lost, 17 moved, net -5.

  • 1 gained, 1 lost, 4 moved: What is the easiest way to add API keys and rate limits to an existing API?
  • 3 lost, 3 moved: Which API platform has the most predictable pricing for a startup?
  • 1 lost, 5 moved: How do I move an API off a single VPS without downtime?
Byname's What changed view for check #6 against check #7, showing the 6 lost answers. The pricing question lost Claude Code with claude-sonnet-5-5 (#2, then linked but not named), Codex CLI (#3, then not named) and the ChatGPT app (#2, then not named).

Close the gap. Then see if it worked.

Missed in 6 of 6Missed question

Which platform is best for hosting a Postgres-backed API close to European users?

What to do: AI named Fly.io, Cloudflare and AWS instead. Write a page on your site that answers this question.

Prompt for your agenta brief your coding agent writes the page from

Handled · unkey.com/blog/eu-postgres-apisTwo checks later

Which platform is best for hosting a Postgres-backed API close to European users?

Linked in 3 answers

  1. ChatGPT app
  2. Claude CodeSonnet 5.5
  3. Perplexity app
Named you: before 0 of 6, now 4 of 6Example data

What buyers see. Not what an API says.

7 apps

App answer

Read from the app a person uses.

  • ChatGPT app
  • Gemini app
  • Google AI Mode
  • Google AI Overview
  • Microsoft Copilot
  • Bing AI Mode
  • Brave AI answers

3 apps

Same model and search

The model your team picks, with web search on.

  • Claude Code
  • Gemini CLI
  • Codex CLI

2 apps

Close stand-in

The nearest match where the app can't be read. Never passed off as the app.

  • Claude app
  • Perplexity app

What people say about you. Not just what AI says.

Ask your agent what you lost.

~/unkey/wwwclaude

Which questions did we lose in check #7?

byname compare_runs before=6 after=7

1 gained · 6 lost · 17 moved · net -5

Check #7 lost 6 answers that check #6 had:

  • Which API platform has the most predictable pricing for a startup? on Claude Code with Sonnet, Codex CLI and the ChatGPT app.
  • What is the easiest way to add API keys and rate limits to an existing API? on the ChatGPT app.
  • How do I move an API off a single VPS without downtime? on Google AI Overview.
  • What are good alternatives to running my own API gateway? on the Perplexity app.

On the ChatGPT app, the pricing question now names Fly.io first.

Add it to your agent

# Claude Code
claude mcp add --transport http byname \
  https://byname.example.com/mcp

Run it on Unkey with one prompt.

  1. Add Unkey's MCP server to your agent

    # Claude Code. Other agents: mcp.unkey.com/install
    claude mcp add --transport http unkey \
      https://mcp.unkey.com
  2. Paste the prompt into your agent

  3. Open the link it gives you

deploy-byname-on-unkey.md
Deploy Byname (https://github.com/unkeyed/byname) to Unkey for me, using Unkey's MCP server. Byname tracks how a brand shows up in AI answers and in Google search. The repository's docs/deploy-unkey.md is the reference for Byname's settings.

1. Connect to Unkey
   Check that Unkey's MCP tools are available (for example projects.listProjects). If they are not:
   - Claude Code: run  claude mcp add --transport http unkey https://mcp.unkey.com
     then tell me to run /mcp, choose unkey, and Authenticate. MCP tools load when a session starts, so if they still do not appear, tell me to restart the session and paste this prompt again.
   - Any other agent: tell me to follow https://mcp.unkey.com/install and stop until I say it is done.
   Signing in opens Unkey in my browser, where I can also create an account. Do every Unkey step below through the MCP tools.

2. Ask me
   For a Postgres connection URL (Neon, Supabase, PlanetScale Postgres, RDS or similar), ideally in AWS us-east-1. It must be the direct connection, or a session-mode pooler, not a transaction-mode pooler such as PgBouncer on port 6432 or Supabase on port 6543: Byname holds session locks for its background jobs. If the provider gives a read/write role and a separate admin role that can create tables, ask for both URLs.
   Do not ask me for a Treg token or provider keys. I enter those in Byname's onboarding after the deploy.

3. Fork Byname
   Run  gh repo fork unkeyed/byname --clone  and note the fork as owner/byname.

4. Create the project and app on Unkey
   - Create a project with slug byname (projects.createProject).
   - Create an app with slug default, sourced from my fork's default branch (apps.createApp with git.repository). If Unkey's GitHub App cannot see the fork, get the install link with github.installApp, give it to me, and retry once I have granted access.
   - On the production environment (environments.updateSettings): Dockerfile "Dockerfile", root directory ".", port 8080, health check GET /healthz, and regions set to us-east-1, or the region closest to my database, with 1 replica. The default region may be elsewhere, so set it explicitly. Set watchPaths to cmd/**, internal/**, web/**, go.mod, go.sum, Dockerfile and .dockerignore, so a change to the docs or the site does not redeploy the app.
   - On the preview environment, set autoDeploy to false. A preview has no variables of its own, and must never point at the production database.

5. Set production variables (environments.setEnvironmentVariables), every secret as writeonly
   - DATABASE_URL: the read/write URL.
   - ENCRYPTION_KEY: generate with  openssl rand -base64 32. Save it to ~/.byname-encryption-key with chmod 600 and tell me to copy it into my password manager. Unkey cannot show a writeonly value again, and Byname cannot read its stored provider keys and channel secrets without it.
   - SETUP_TOKEN: generate with  openssl rand -hex 32.
   - CLIENT_IP_HEADER: X-Forwarded-For. Unkey's gateway sets it to the real client address, so Byname throttles each client separately.
   Do not set PORT. Never print a database password, and never write a secret into the repository.

6. Migrations
   If I gave a separate admin URL, apply the migrations from the clone before the first deploy and keep the admin URL off Unkey:
     MIGRATION_DATABASE_URL='the admin url' go run ./cmd/byname migrate
   Otherwise DATABASE_URL must be able to create tables. Byname migrates when it starts.

7. Protect it at Unkey's gateway (gateway.setPolicies on production)
   - Firewall, deny: request paths matching dotfiles and secrets (/.env, /.git, /.aws, /.ssh), backups and keys (.sql, .bak, .zip, .pem, .key), PHP and WordPress probes (.php, /wp-admin, /wp-login, /xmlrpc.php, /phpmyadmin, /cgi-bin) and appliance scanners (/actuator, /server-status, /HNAP1), case-insensitive. Never block /.well-known/, /v1/openapi.yaml, /setup/, /invite/ or /auth/gsc/callback.
   - Rate limits per remote IP: ^/oauth/(register|authorize)$ at 30 a minute, and /auth/ at 120 a minute.

8. Deploy
   - Create a deployment on production (deployments.createDeployment) and follow it with deployments.getDeployment and deployments.listBuildLogs until it is ready.
   - Set PUBLIC_URL to the stable address without a deployment id, https://byname-<workspace>.unkey.app, then deploy again. Variables and gateway policies only apply to a new deployment, and passkeys only work at PUBLIC_URL.
   - Once the second deployment is ready and current, stop the first one (deployments.stopDeployment). Unkey keeps a previous deployment running, and every running copy holds database connections.

9. Check and hand over
   - PUBLIC_URL/healthz and PUBLIC_URL/auth/setup/SETUP_TOKEN both answer 200, and PUBLIC_URL/.env answers 403.
   - Give me PUBLIC_URL/setup/SETUP_TOKEN to create the first account with a passkey. Tell me to add a second passkey under Settings > Account.
   - Tell me the next stop is onboarding: my brand and domain, competitors, questions, where people ask with a Treg token or my own keys, Search Console, and the schedule with spend caps. Nothing runs until I finish it.
   - Tell me that each later deploy leaves the previous deployment running, and to stop it once the new one is current.
   - Finish with a short summary: the URL, the Unkey project, the variables you set, where the encryption key is saved, and anything you could not do.

Or run it anywhere with Docker

One container and Postgres. Self-hosting guide

git clone https://github.com/unkeyed/byname.git
cd byname
echo "ENCRYPTION_KEY=$(openssl rand -base64 32)" >> .env
docker compose up -d --build --wait
docker compose logs app | grep -A2 'Open this link'