If you’re using a coding agent (Claude Code, Cursor, etc.), it can obtain an API key
for you automatically. The agent generates a one-time URL, you open it in your browser
and approve, and the agent receives the key — no copy-paste needed.
# 1. Agent generates a random tokenTOKEN=$(openssl rand -hex 32)# 2. You open this URL and sign in# https://app.casparser.in/agent-auth?token=${TOKEN}&client_name=YOUR_AGENT_NAME# 3. Agent polls until you approvecurl -s https://api.casparser.in/v1/agent-auth/token/${TOKEN}# → {"status": "approved", "api_key": "sk_...", "email": "..."}
See the API reference for full details on the agent auth endpoints.
Never expose your API key in client-side code. Use access tokens for frontend applications.
// Get token from your backendconst { access_token } = await fetch('/api/casparser/token').then(r => r.json());// Use token in place of API keyconst response = await fetch('https://api.casparser.in/v4/smart/parse', { method: 'POST', headers: { 'x-api-key': access_token }, // Use token here body: formData});
from flask_limiter import Limiterlimiter = Limiter(app, default_limits=["60 per minute"])@app.route('/api/parse')@limiter.limit("10 per minute")def parse_cas(): # Your parsing logic pass