D
Damira AI

API Reference

Call Damira from your own scripts and tools with an oncall_sk_ API key — authentication, endpoints, and rate limits.

Most people never need the API. The Cursor and Claude Code plugin is the main way to use Damira: your AI calls Damira for you. Use the API when you're building your own integration, such as a script, a chatbot, or an internal tool.

The plugin calls the same chat endpoint documented below.

Base URL

https://damiraai.com

Every endpoint is served from the site gateway under /api/extension/. The gateway checks your key, applies your plan's limits, and forwards the request to the Damira agent. You can't call the agent directly with a user key.

Authentication

Send your key as a bearer token:

Authorization: Bearer YOUR_API_KEY

Get a key:

  1. Sign in at damiraai.com.
  2. Go to Dashboard → API Keys and click Create key.
  3. Copy the key straight away. It's shown once and can't be retrieved later.

Keys start with oncall_sk_ followed by 43 URL-safe characters. A missing, malformed, or revoked key returns:

{ "error": "Invalid or missing API key" }

with status 401.

To use the same key in the plugin, see Install → API key.

Ask Damira

POST /api/extension/agent/chat-sync

Send a question and get back the full answer in a single JSON response.

curl -X POST https://damiraai.com/api/extension/agent/chat-sync \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "BGP neighbor 10.1.1.1 is stuck in Active state on an ASR 1001-X"}'

Request body

FieldTypeDescription
messagestring, requiredYour question, symptoms, or pasted show output.
sessionIdstringThe session_id from an earlier response. Continues that conversation.
executionModestringadvisor (default), guided, or lab. Leave it on advisor. Damira recommends commands and you run them.

Response

{
  "session_id": "3f6c1e2a-9b7d-4c1e-8a55-0d2f4e6b7a91",
  "response": "Active means the TCP session to 10.1.1.1 never came up...",
  "tool_calls": [],
  "deliverables": [],
  "usage": {
    "input_tokens": 4210,
    "output_tokens": 980,
    "total_tokens": 5190,
    "duration_ms": 18400
  }
}
  • response is the answer in Markdown.
  • session_id: send it back as sessionId to ask a follow-up in the same conversation.
  • deliverables lists any files the answer produced, each with filename, content, and type.

Follow-up in the same session

curl -X POST https://damiraai.com/api/extension/agent/chat-sync \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Here is show ip bgp summary: ...", "sessionId": "3f6c1e2a-9b7d-4c1e-8a55-0d2f4e6b7a91"}'

Allow time for the answer. Most answers take 15–60 seconds. If Damira doesn't answer within 90 seconds, the request returns 504 with {"error": "Damira took too long to answer"}. Set your HTTP client's timeout above 90 seconds.

Check your plan and usage

GET /api/extension/usage

Returns your plan and this month's deep-research usage.

curl https://damiraai.com/api/extension/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "tier": "free",
  "capabilities": ["Troubleshooting (11 domains)", "Quick answers", "Basic documentation"],
  "deepResearch": null,
  "activityLevel": "light"
}
  • deepResearch is { "used": 2, "limit": 15 } on plans that include deep research, and null on Free. A limit of -1 means unlimited.
  • activityLevel is light, moderate, or heavy, based on this month's usage.

Rate limits

Limits apply per account, not per key, so creating more keys doesn't raise them. The daily count resets each day.

PlanQueries per dayQueries per minute
Free505
Starter30015
Pro80020
Team2,00060
EnterpriseUnlimited100

Going over either limit returns 429 with a Retry-After header, in seconds:

{ "error": "Rate limit exceeded: 50/50 requests today" }

Errors

StatusMeaning
400The body failed validation. For example, message is missing or empty.
401The key is missing, malformed, or revoked.
429You hit your daily or per-minute limit. Wait for Retry-After.
504No answer within 90 seconds. Retry, or narrow the question.

Schema

There's no public OpenAPI schema. The endpoints on this page are the supported surface.

  • Install: the Cursor and Claude Code plugin
  • MCP: the tools your AI calls
  • Pricing: plans and limits

On this page