Get a free Gemini API key
Google AI Studio offers a free Gemini API key with no credit card required.Open Google AI Studio
Go to aistudio.google.com/app/apikey and sign in with your Google account.
Create an API key
Click Create API key and copy the generated key. Keep it somewhere safe — you won’t be able to view it again after closing the dialog.
Open Postcard Settings
Navigate to postcard.fartlabs.org and click Settings in the navigation bar.
Your API key is stored in a browser cookie named
postcard_api_key with a 30-day expiry. When you submit a URL for analysis, the key is included in the POST request body as userApiKey and passed to the Postcard server, which then uses it to call the Google Gemini API. The key is not stored server-side — it is only used for the duration of the analysis request.How the key is used
When you submit a URL for analysis, your browser reads thepostcard_api_key cookie value and includes it in the POST request body as userApiKey. The Postcard server receives this key and passes it to the Google Gemini SDK when calling the corroboration and auditing agents. If no userApiKey is present in the request and no server-side default is configured via GOOGLE_GENERATIVE_AI_API_KEY, the pipeline will not start.
Managing your key
From Settings you can:- Save Key — stores a new or updated key in the cookie
- Test Key — sends a test POST request to
/api/postcardswith your stored key to confirm it is accepted - Clear — removes the cookie from your browser
Rate limits on the free tier
For self-hosters: server-side default key
If you are running Postcard yourself, you can set a server-side default Gemini API key via theGOOGLE_GENERATIVE_AI_API_KEY environment variable in your .env file:
userApiKey is provided in the request. This is useful for private deployments where you want all users to share a single key without requiring individual configuration.
A
userApiKey supplied in the POST request body always takes precedence over the server-side GOOGLE_GENERATIVE_AI_API_KEY environment variable.