Piye

Your own API keys and local models

Use your own Anthropic, OpenAI, Google, xAI or Mistral key in Code, or run models on your computer with Ollama. How keys are stored, checked and chosen.

On this page

What your own key does

An API key lets Piye call an AI company with your account: the company bills you directly and Piye adds nothing. Own keys work in Code (and Piye Studio), on every plan, with or without a Piye account. Visual always builds on Piye's credits.

Supported makers: Anthropic, OpenAI, Google, xAI and Mistral.

Add a key

  1. Create an API key on the maker's own site (for example Anthropic's console, OpenAI's platform or Google AI Studio).
  2. In Piye, switch to Code and open Settings, AI, then Personal API keys, Configure.
  3. Paste the key next to its maker and save.

Piye checks the key with the maker straight away (it asks for the free list of models). A key the maker refuses isn't saved, and Piye tells you why.

Settings, AI in Code
Settings, AI: Disable AI, the default model, the AI's language, Personal API keys and MCP.

Important

Add keys in Settings only, never in a chat. A key typed in a chat goes into the conversation.

Once a maker's key is saved, all of that maker's models open in the model menu.

Where keys are kept

Keys go straight into your computer's own secure storage: the Keychain on a Mac, the system keyring on Linux. On Linux without a keyring, Piye keeps them in a file only your user can read, and Settings says so. Keys are never written into your project, and Piye's own screens only ever learn whether a key is saved, never the key itself.

How Piye chooses between credits and your key

You areWhat runs
Not signed inYour key runs, straight away.
Signed inPiye credits first. Your key covers the models your plan doesn't include.
Signed in, with Only API keys onEvery Code request runs on your keys. A model with no key doesn't run, and credits are never used.

Only API keys is in Settings, AI (Code), once you are signed in and have saved a key. It never applies to Visual.

When your credits run out, Piye asks you to add credits. It never moves the work to your key without asking.

What the agent can do on your key

On your own key (or a local model), the Code agent has the standard IDE tools: files, the terminal, the editor and the chat, the same level as Claude Code or Codex working in Piye. Piye's full agent, with its tools for previews, phones, deploy, Operations and the rest, runs on Piye's credits.

Replies on your key show what they cost you, for example "$0.42 on your key", from the maker's own prices.

Local models with Ollama

Ollama runs open models on your own computer, so nothing leaves it.

  1. Install Ollama and download a model (for example ollama pull llama3.2 in a terminal).
  2. In Piye, open Settings, AI, Local Ollama and turn on Use local Ollama.
  3. Piye looks for Ollama at http://127.0.0.1:11434. Change Ollama URL if you run it elsewhere, then press Refresh.

Piye says how many local models are ready. They appear in the model menu as "On this computer", cost nothing, and have the same tools as your own keys.

Privacy Mode

Privacy Mode turns off Piye Cloud and your own keys, so nothing about your code leaves the computer. Local models through Ollama keep working in Code. In Visual, building needs Piye's AI, so only asking questions with a local model works. See Privacy.

© 2026 Piye TechnologiesPrivacyTermsCookiesSupportChangelog