Your AI server needs a key

locked server? hand PocketHam the key. once.

How do I add the key?

  1. On the computer that runs the server, open PocketHam.
  2. Click AI apps.
  3. Scroll to Add a server by hand.
  4. In the address box, type where the server answers, for example http://127.0.0.1:8000. Use the port shown next to Needs an API key.
  5. Paste the key into Key (if it needs one). A name is optional.
  6. Click Add. PocketHam checks the address and the key before saving, then shows the server with key saved under it.
  7. Open Chat on your iPhone and pick one of its models.

See it on an iPhone

50 seconds: chat, an agent asking first, ComfyUI, the terminal and files, all on a home computer. Get PocketHam on the App Store.

Why isn't my model showing up in Chat?

PocketHam finds local AI servers on your computer by itself. When a server is locked with an API key, PocketHam can see that it is there but isn't allowed to list its models, so there is nothing to chat with yet. You will see it in two places:

  • On the computer, the AI apps page lists it as Needs an API key with its port number.
  • On the iPhone, it is listed as unavailable with the note Needs a key: add it on the computer under AI apps, Add a server by hand.

Adding the key above takes about a minute and you only do it once.

Where do I find my server's key?

The key is whatever was set when the server was started. PocketHam can't look it up for you, on purpose.

  • llama.cpp (llama-server): the value after --api-key in the start command, a line in the file named by --api-key-file, or the LLAMA_API_KEY environment variable.
  • vLLM: the value after --api-key, or the VLLM_API_KEY environment variable.
  • LiteLLM: the master key (LITELLM_MASTER_KEY, or master_key in its config file), or a virtual key you created for PocketHam.
  • In Docker: look in the container's compose file or .env file for one of the names above.
  • Hermes Agent: nothing to do. PocketHam reads Hermes's own key on the computer by itself.

It says the key is wrong

  • The server turned that key down. Check the key and try again. The address is right and the key is not. Copy it again, watching for a missing character or a space at the end.
  • This server needs a key. Paste it in the key box. The key box was left empty.
  • Nothing answered at that address: the server isn't running, or the port is different. Check the port in the server's own window or start command.
  • Something answered, but not like an AI server. The port belongs to another program. PocketHam needs a server with an OpenAI-style API or Ollama's.

Does my key go to my phone?

No. The key is saved on the computer and stays there. Your iPhone only receives the server's name and its list of models, and your chats travel end to end encrypted between the phone and that computer. Remove the server in the same place any time and the key is gone with it. More on the privacy page.

Do I need a key at all?

For PocketHam, no. It talks to your AI server on the computer itself, so a server that only listens on that computer (127.0.0.1) is already closed to everyone else, and your phone reaches it through PocketHam's encrypted connection. A key earns its keep when the server is open to your network, for example so another computer can use it. If that is your setup, keep the key and add it as above.

The same steps add other servers too

Add a server by hand is also how you add an AI server PocketHam can't see by itself: one on another computer on your network, or one behind a proxy. Type its address, add a key if it has one, and it joins the list.

More: Ollama and LM Studio on iPhone · Strata on iPhone · ComfyUI on iPhone · Claude Code and agents on iPhone · Your terminal on iPhone · PocketHam vs Tailscale · Local AI in CarPlay · Support