Quickstart
Add AI to Your App in 5 Minutes
Get your API key, make your first call, and ship AI features. No backend required.
Prerequisites
- A Behest AI account (free, sign up at behest.ai/dashboard — no credit card required)
- Any HTTP client — fetch, axios, requests, curl, or your language of choice
1Get Your API Key
- Sign up at behest.ai/dashboard
- Create a new project
- Configure your allowed CORS origins (e.g.,
http://localhost:3000for local development) - Copy your project API key
Your project URL will look like https://your-project.behest.app
2Make Your First API Call
JavaScript (fetch)
const response = await fetch(
"https://your-project.behest.app/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gemini-2.5-flash",
messages: [
{ role: "user", content: "Summarize this contract" }
],
}),
}
);
const data = await response.json();
console.log(data.choices[0].message.content);Python (requests)
import requests
response = requests.post(
"https://your-project.behest.app/v1/chat/completions",
headers={
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json",
},
json={
"model": "gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Summarize this contract"}
],
},
)
data = response.json()
print(data["choices"][0]["message"]["content"])curl
curl -X POST https://your-project.behest.app/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Summarize this contract"}
]
}'3What Happens Automatically
When you make that API call, Behest handles everything behind the scenes:
CORS handled — Browser requests just work
Auth validated — API key verified, tenant isolated
PII scrubbed — Sensitive data detected and protected
Prompts defended — Injection attacks blocked
Rate limits enforced — Per-IP, per-project, per-user
Memory persisted — Conversation context maintained
Tokens tracked — Usage and spend recorded
Fully observable — Traces, metrics, and logs captured
Next Steps
API Reference
Full endpoint documentation, request/response schemas, and error codes.
CORS Guide
How Behest handles CORS so you can call your LLM from the browser.
Add AI to React
Complete React component example with state management and streaming.
Add AI to Next.js
Server Component and Client Component patterns for Next.js apps.
Multi-Tenant Auth
JWT, API keys, tenant isolation, and per-user rate limiting.
PII Protection
Configure PII Shield modes, actions, and per-entity settings.