| name | exa-multi-env-setup |
| description | Configure Exa across development, staging, and production environments.
Use when setting up multi-environment search pipelines, managing API key isolation,
or configuring per-environment search limits and caching.
Trigger with phrases like "exa environments", "exa staging", "exa dev prod",
"exa environment setup", "exa multi-env".
|
| allowed-tools | Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*) |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","exa","deployment","api","environments"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Exa Multi-Environment Setup
Overview
Exa charges per search request at api.exa.ai. Multi-environment setup focuses on API key isolation per environment, request limits and caching to control costs in staging, and appropriate numResults/content settings per tier.
Prerequisites
- Exa API key(s) from dashboard.exa.ai
exa-js installed (npm install exa-js)
- Optional: Redis for search result caching in staging/production
Environment Strategy
| Environment | Key Isolation | numResults | Content | Cache TTL |
|---|
| Development | Shared dev key | 3 | highlights only | None |
| Staging | Staging key | 5 | text (1000 chars) | 5 min |
| Production | Prod key | 10 | text (2000 chars) | 1 hour |
Instructions
Step 1: Environment-Aware Configuration
import Exa from "exa-js";
type Env = "development" | "staging" | "production";
interface ExaEnvConfig {
apiKey: string;
defaultNumResults: number;
maxCharacters: number;
searchType: "auto" | "neural" | "keyword";
cacheEnabled: boolean;
cacheTtlSeconds: number;
}
const : <, <, > & { : }> = {
: {
: ,
: ,
: ,
: ,
: ,
: ,
},
: {
: ,
: ,
: ,
: ,
: ,
: ,
},
: {
: ,
: ,
: ,
: ,
: ,
: ,
},
};
(): {
env = (process.. || ) ;
config = configs[env] || configs.;
apiKey = process.[config.];
(!apiKey) {
();
}
{ ...config, apiKey };
}
(): {
(().);
}