Developers
Cited answers in one API call.
The same retrieval and models as the Prism app, over REST. Send a question, get back text, citations with quotes and a count of unsupported claims.
- Uptime, 90 days
- 99.98%
- Regions
- US, EU, CA
- SDKs
- 4
200POST /v1/answers
412 ms
{
"id": "ans_01J9ZQ4M7R",
"model": "prism-2",
"text": "Refunds moved from 14 to 30 days in March [1].",
"citations": [
{
"index": 1,
"title": "Refund policy v3",
"source": "wiki",
"quote": "Customers may request a refund within 30 days"
}
],
"unsupported_claims": 0,
"usage": { "input_tokens": 3182, "output_tokens": 96 }
}Quickstart
Your first answer in three steps.
- 1
Create a key
In the dashboard, open Settings → API keys. Free workspaces get test keys with 100k tokens a month. Keep keys on the server.
Terminal
export PRISM_API_KEY="pk_test_your_key_here" - 2
Ask a question
Point
sourcesat your workspace, the web or both. Every answer comes back with citations and quotes.curl https://api.prism.example/v1/answers \ -H "Authorization: Bearer $PRISM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "prism-2", "question": "What changed in our refund policy this year?", "sources": ["workspace", "web"] }'import Prism from "@prismlabs/sdk"; const prism = new Prism({ apiKey: process.env.PRISM_API_KEY }); const answer = await prism.answers.create({ model: "prism-2", question: "What changed in our refund policy this year?", sources: ["workspace", "web"], }); console.log(answer.text); for (const c of answer.citations) console.log(c.index, c.title);from prismlabs import Prism client = Prism() # reads PRISM_API_KEY from the environment answer = client.answers.create( model="prism-2", question="What changed in our refund policy this year?", sources=["workspace", "web"], ) print(answer.text) for c in answer.citations: print(c.index, c.title) - 3
Stream it
Set
"stream": trueto receive server-sent events:source,textand a finaldonewith usage.curl -N https://api.prism.example/v1/answers \ -H "Authorization: Bearer $PRISM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "prism-2-flash", "question": "Summarise this week in support", "stream": true}'const stream = await prism.answers.stream({ model: "prism-2-flash", question: "Summarise this week in support", }); for await (const event of stream) { if (event.type === "text") process.stdout.write(event.text); }with client.answers.stream( model="prism-2-flash", question="Summarise this week in support", ) as stream: for event in stream: if event.type == "text": print(event.text, end="")
Reference
Endpoints
Base URL https://api.prism.example. JSON in, JSON out, versioned in the path. Breaking changes get a new version and twelve months of overlap.
- POST
/v1/answersAsk a question, get a cited answer - POST
/v1/searchRanked passages, no generation - POST
/v1/documentsAdd or update a document in your index - GET
/v1/documents/{id}A document and its sync status - DELETE
/v1/documents/{id}Remove a document from the index - POST
/v1/briefsSchedule a recurring question - POST
/v1/embeddingsVectors from prism-embed-1 - GET
/v1/usageToken usage by key and day
SDKs
Official libraries, typed and tested.
Retries with backoff, streaming helpers and pagination built in. Open source under the MIT license.
JavaScriptv3.2
Node 20+, Deno, Bun and edge runtimes. Full TypeScript types.
npm i @prismlabs/sdkPythonv3.1
Python 3.9+, sync and async clients, Pydantic models.
pip install prismlabsGov1.4
Context-aware, zero dependencies beyond the standard library.
go get prism.example/goRubyBeta
Ruby 3.2+, with a Rails generator for webhooks.
gem install prismlabs
Limits
Rate limits
Limits apply per workspace. Every response carries x-ratelimit-remaining and x-ratelimit-reset; a 429 includes retry-after. The SDKs back off for you.
| Plan | Requests / min | Tokens / min | Concurrent streams |
|---|---|---|---|
| Free | 20 | 40,000 | 2 |
| Team | 600 | 2,000,000 | 50 |
| Enterprise | Custom | Custom | Custom |
Need more? Ask for a limit increase. Most are approved the same day.
Ship cited answers this week.
Test keys are free. Production keys come with every Team plan, including 1M tokens a month.