API
Last updated 5 September 2026
Refine a prompt from your own code. Available on the Brevik API plan.
1.Authentication
Create a key in Settings → Billing → API keys. It is shown once and stored only as a hash, so a lost key must be revoked and replaced rather than recovered.
Authorization: Bearer brv_your_key_here2.Refine a prompt
POST https://brevik.app/v1/refine
curl https://brevik.app/v1/refine \
-H "Authorization: Bearer $BREVIK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "write a cold email for my design agency",
"target": "claude"
}'prompt is required. context is optional background — a page’s text, a brief — that the refinement conditions on. target is one of generic, chatgpt, claude or gemini.
3.The response
{
"prompt": "You are an expert B2B copywriter…",
"title": "Cold email for a design agency",
"score": 62,
"missing": ["constraints", "successCriteria"],
"whyStronger": ["Named the audience explicitly", "…"],
"id": "5f0e…"
}missing names the fields the prompt did not supply. Passing them in the text — an audience, a length limit, what a good answer looks like — is what raises the score on the next call.
4.Limits and errors
Each call uses one refinement from your monthly allowance (1,000 on the API plan). At the limit the API returns 402 with reason: "monthly_limit"; buy a top-up in Settings or enable overage.
401 means the key is missing, revoked or wrong. 403 means the account is not on the API plan. 502 means the model failed — these are safe to retry once.