> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paperline.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Keys

> Use your own OpenAI, Anthropic, or Google API keys with Paperline. Build iOS apps for free with GPT-5, Claude, or Gemini models.

## Why Use Your Own Keys?

* **No credit limits**: Use as much as you need
* **Direct billing**: Pay your AI provider directly
* **Full control**: Manage your own usage and costs

## Getting API Keys

### OpenAI API Key

1. Go to [platform.openai.com](https://platform.openai.com)
2. Sign in or create an account
3. Navigate to **API Keys** in the sidebar
4. Click **Create new secret key**
5. Copy the key (starts with `sk-`)

### Anthropic API Key

1. Go to [console.anthropic.com](https://console.anthropic.com)
2. Sign in or create an account
3. Navigate to **API Keys**
4. Click **Create Key**
5. Copy the key (starts with `sk-ant-`)

### Google API Key

1. Go to [aistudio.google.com](https://aistudio.google.com)
2. Sign in with your Google account
3. Click **Get API key** in the sidebar
4. Click **Create API key**
5. Copy the key

## Adding Keys to Paperline

1. Open Paperline
2. Go to **Settings**
3. Enter your keys:
   * **OpenAI API Key**: For GPT-5
   * **Anthropic API Key**: For Claude Haiku 4.5
   * **Google API Key**: For Gemini 2.5 Flash
4. Click **Save**

Your keys are stored securely on your Mac using encrypted storage.

## Security

<AccordionGroup>
  <Accordion title="Where are my keys stored?">
    API keys are stored locally on your Mac using macOS Keychain encryption. They are never sent to Paperline servers.
  </Accordion>

  <Accordion title="Can Paperline see my keys?">
    No. Your keys are used only to make API calls directly from your Mac to the AI providers.
  </Accordion>

  <Accordion title="What if I lose my keys?">
    You can generate new keys from your provider's dashboard (OpenAI, Anthropic, or Google). Old keys can be revoked there as well.
  </Accordion>
</AccordionGroup>

## Billing

When using your own API keys:

* **OpenAI**: Billed through your OpenAI account
* **Anthropic**: Billed through your Anthropic account
* **Google**: Billed through your Google Cloud account

Paperline does not charge for AI usage when you use your own keys.

### Estimated Costs

| Model            | Approximate Cost per 1K tokens   |
| ---------------- | -------------------------------- |
| GPT-5            | \~$0.00125 input / $0.01 output  |
| Claude Haiku 4.5 | \~$0.001 input / $0.005 output   |
| Gemini 2.5 Flash | \~$0.0003 input / $0.0025 output |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Invalid API key error">
    * Check that you copied the full key
    * Ensure there are no extra spaces
    * Verify the key is active in your provider's dashboard
  </Accordion>

  <Accordion title="Rate limit errors">
    Your API key may have usage limits. Check your provider's dashboard for current limits and usage.
  </Accordion>

  <Accordion title="Billing errors">
    Ensure you have a valid payment method set up with your AI provider.
  </Accordion>
</AccordionGroup>
