Skip to content

Obtaining API Keys

Medical Fact Checker (MFC) and BM Librarian Lite support multiple AI providers. This guide explains how to obtain API keys from each supported provider.

What is an API Key?

An API key is like a personal password that lets Medical Fact Checker communicate with AI services on your behalf. When you ask the app to fact-check a medical claim, it sends your question to an AI provider (like Anthropic's Claude or OpenAI's GPT), which analyzes the evidence and sends back a response. The API key identifies you to the AI provider so they know who to bill for the service.

This is a "Bring Your Own Key" model. You create your own account directly with the AI provider of your choice, and you pay them directly for what you use. Medical Fact Checker does not act as a middleman, does not mark up prices, and receives no payment or commission from any provider. This keeps costs transparent and as low as possible - you pay only what the AI provider charges, with no hidden fees.

Which Provider Should I Choose?

  • Claude (Anthropic): Recommended for best medical analysis quality
  • OpenAI: Widely used, good general performance
  • DeepSeek: Cost-effective option with strong performance
  • Mistral: European provider with free tier - no credit card required
  • Ollama: Free, runs locally on your computer (advanced users)

No Budget Surprises

All providers offer prepaid, no-auto-top-up options. You can deposit a small amount (even just $5) and use the system extensively - typically hundreds of fact-checks - until your balance runs out. Your account simply stops working when credits are exhausted; you will never receive an unexpected bill. This makes it completely safe to experiment without financial risk.

Try for Free with Mistral

Mistral is the only provider offering a completely free tier - just sign up with your email, no credit card required. This is perfect for trying out Medical Fact Checker before committing to a paid provider.


Anthropic (Claude)

Claude is Anthropic's AI assistant and is the recommended provider for medical fact-checking due to its strong reasoning capabilities.

Step 1: Create an Anthropic Account

  1. Navigate to console.anthropic.com
  2. Click Sign up or Continue with Google
  3. Enter your email address and create a password
  4. Verify your email by clicking the link sent to your inbox

Anthropic Sign Up Page

Step 2: Set Up Billing

  1. After signing in, you'll be prompted to provide information about your intended use
  2. Add your billing details (credit card or other payment method)
  3. You can choose between:
  4. Single payment: Add credits manually
  5. Auto-reload: Automatically add credits when balance is low

Free Credits

New accounts often receive free credits to get started. Check your dashboard for available credit balance.

Step 3: Create Your API Key

  1. From your dashboard, click API Keys in the sidebar
  2. Click the + Create Key button
  3. Give your key a descriptive name (e.g., "Medical Fact Checker")
  4. Click Create Key

Anthropic API Key Creation

Step 4: Copy and Store Your Key

  1. Important: Copy the key immediately - it will only be shown once
  2. Store it securely (password manager recommended)
  3. Never share your API key publicly

Your Anthropic API key will look like: sk-ant-api03-...


OpenAI

OpenAI provides GPT models including GPT-4 and GPT-4o.

Step 1: Create an OpenAI Account

  1. Go to platform.openai.com
  2. Click Sign Up in the top right corner
  3. Register with email, or use Google/Microsoft account
  4. Verify your email address

OpenAI Sign Up Page

Step 2: Navigate to API Keys

  1. Log in to the OpenAI Platform
  2. Click your profile icon in the top right
  3. Select View API Keys from the dropdown menu

Step 3: Generate a New API Key

  1. Click + Create new secret key
  2. Provide a name for the key (e.g., "Medical Fact Checker")
  3. Select the project to associate with this key
  4. Click Create secret key

OpenAI API Key Creation

Step 4: Copy and Store Your Key

  1. Copy the key immediately - you cannot view it again
  2. Store it in a secure location
  3. If lost, you'll need to create a new key

Your OpenAI API key will look like: sk-proj-...

Step 5: Set Up Billing

  1. Click the gear icon to go to Settings
  2. Select Billing from the left menu
  3. Add a payment method and credits

Free Trial

OpenAI may provide free trial credits for new accounts.


DeepSeek

DeepSeek offers cost-effective AI models with strong performance.

Step 1: Create a DeepSeek Account

  1. Visit platform.deepseek.com
  2. Click Sign Up or register with your email
  3. Verify your account

DeepSeek Sign Up Page

Step 2: Access API Keys

  1. Log in to the DeepSeek Platform
  2. Navigate to platform.deepseek.com/api_keys

Step 3: Create Your API Key

  1. Click to create a new API key
  2. Name your key appropriately
  3. Copy and store the key securely

Your DeepSeek API key format will be provided upon creation.

OpenAI Compatibility

DeepSeek uses an API format compatible with OpenAI, making integration straightforward.


Mistral AI

Mistral is a European AI company offering competitive models - and the only provider with a completely free tier requiring no credit card.

Free Tier Available

Mistral's Experiment plan is completely free. Just sign up with your email - no credit card, no payment information required. Perfect for trying Medical Fact Checker risk-free.

Step 1: Create a Mistral Account

  1. Go to console.mistral.ai
  2. Click Sign Up and register with your email
  3. Verify your email address
  4. No credit card or payment information needed!

Mistral Sign Up Page

Step 2: Choose the Free Plan

  1. After signing in, you'll be asked to choose a plan
  2. Select Experiment (Free tier)
  3. That's it - no billing setup required

The Experiment plan includes:

  • Access to all Mistral models
  • Sufficient quota for personal use and testing
  • No time limit

Step 3: Create Your API Key

  1. Navigate to the API keys section in your workspace
  2. Click to create a new API key
  3. Give it a name (e.g., "Medical Fact Checker")
  4. Copy and store it immediately

Mistral API Key Creation

Your Mistral API key will look like a long alphanumeric string.

Upgrading Later

If you need higher rate limits or more usage, you can upgrade to the Scale plan (pay-as-you-go) at any time from admin.mistral.ai.

Security

Never share your API key. Even on the free tier, your key is linked to your account.


Entering Your API Key in the App

  1. Open Medical Fact Checker
  2. Tap the Settings icon (gear)
  3. Select your preferred AI provider
  4. Tap API Key
  5. Paste your key and tap Save

Your key is stored securely in the iOS Keychain.

  1. Open Medical Fact Checker
  2. Go to Settings (⌘,)
  3. Select your AI provider from the dropdown
  4. Enter your API key in the field
  5. Click Save

Your key is stored securely in the macOS Keychain.

  1. Open Medical Fact Checker
  2. Tap the Menu icon (three dots or hamburger)
  3. Select Settings
  4. Choose your AI provider
  5. Enter your API key
  6. Tap Save

Your key is stored using Android's EncryptedSharedPreferences.

You can set your API key via environment variable or the settings GUI:

Environment Variable:

export ANTHROPIC_API_KEY="sk-ant-api03-..."
# or
export OPENAI_API_KEY="sk-proj-..."

Settings GUI:

  1. Launch the application
  2. Go to SettingsAPI Configuration
  3. Enter your API key for the desired provider
  4. Click Save

Security Best Practices

Keep Your Keys Safe

  • Never share your API key publicly (GitHub, forums, screenshots)
  • Never commit API keys to version control
  • Store keys in a password manager
  • Use environment variables for development
  • Rotate keys periodically and if you suspect compromise
  • Set spending limits in your provider's dashboard

What to Do If Your Key Is Compromised

  1. Immediately revoke the compromised key in your provider's dashboard
  2. Create a new key and update your applications
  3. Check your billing for unauthorized usage
  4. Contact the provider's support if you notice suspicious activity

Cost Management

All providers charge based on usage (tokens processed). The good news: you're always in control.

No Surprise Bills

Every provider offers prepaid credits with no auto-top-up:

  1. Deposit a small amount - even $5 is enough for hundreds of fact-checks
  2. Use until exhausted - the service simply stops when credits run out
  3. No automatic charges - you must manually add more credits
  4. Full visibility - check your balance anytime in the provider dashboard

This means you can experiment freely. The worst that can happen is your credits run out and you need to add more.

Typical Costs

A single fact-check typically costs:

Provider Approximate Cost per Fact-Check
Mistral (Experiment) Free
DeepSeek $0.001 - $0.01
Claude $0.02 - $0.10
OpenAI GPT-4o $0.02 - $0.10

With a $5 deposit, you can run hundreds of fact-checks with most providers.

Additional Controls

  1. Provider spending limits - Set maximum monthly spend in your provider dashboard
  2. App budget controls - Medical Fact Checker apps let you set per-analysis and monthly limits
  3. Choose efficient models - Smaller/faster models cost less per query

Budget Controls in Medical Fact Checker

The iOS, macOS, and Android apps include built-in budget controls. Set a maximum spend per analysis and a monthly budget cap for additional peace of mind.