Text generation
Draft, summarize, translate, and converse with the Prism-2 model family.
One clean REST API for chat, embeddings, vision, and tool use — with official SDKs for Python and JavaScript, transparent usage, and production-grade reliability.
Everything you need to ship AI features, behind one key.
Draft, summarize, translate, and converse with the Prism-2 model family.
Turn text into vectors for semantic search, clustering, and RAG pipelines.
Understand images, screenshots, charts, and documents out of the box.
Let models call your functions and APIs with typed, validated arguments.
Start here, then go deeper.
Make your first API call in about five minutes — install the SDK, configure a key, and get a model response back.
Prism ships official SDKs for Python and JavaScript. Install the one that matches your stack — or skip the SDK and call the REST API directly with any HTTP client.
pip install prism-ai
npm install @prism-ai/sdk
Create a key in the dashboard, then export it as an environment variable. The SDK picks up PRISM_API_KEY automatically — no need to pass it in code.
# macOS / Linux
export PRISM_API_KEY="pk_live_51NxT…"
Send a chat completion to prism-2-flash, our fastest model. The SDK reads your key from the environment and returns a typed response object.
from prism_ai import Prism
client = Prism() # reads PRISM_API_KEY from the environment
reply = client.chat.completions.create(
model="prism-2-flash",
messages=[
{"role": "user", "content": "Say hello in one sentence."}
],
)
print(reply.choices[0].message.content)
import Prism from "@prism-ai/sdk";
const client = new Prism(); // reads PRISM_API_KEY from the environment
const reply = await client.chat.completions.create({
model: "prism-2-flash",
messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(reply.choices[0].message.content);
curl https://api.prism.ai/v1/chat/completions \
-H "Authorization: Bearer $PRISM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "prism-2-flash",
"messages": [
{ "role": "user", "content": "Say hello in one sentence." }
]
}'
A successful call returns JSON like this:
{
"id": "chat_9f2c81d4",
"model": "prism-2-flash",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello there — it's a pleasure to meet you!"
},
"finish_reason": "stop"
}
],
"usage": { "input_tokens": 14, "output_tokens": 12 }
}
Every endpoint, parameter, and response shape is documented in the API reference.
REST endpoints for the Prism AI platform. Requests are authenticated with a Bearer key and every response is JSON.
https://api.prism.ai/v1/modelsReturns the models available to your workspace, including context window, supported modalities, and pricing tier. Results are sorted by release date, newest first.
Query parameters
| Name | Type | Description |
|---|---|---|
limit | integer | Maximum number of models to return. Defaults to 20, max 100. |
after | string | Pagination cursor from a previous response. |
Responses
Example request
curl https://api.prism.ai/v1/models \
-H "Authorization: Bearer $PRISM_API_KEY"
/v1/chat/completionsGenerates a model response for a list of messages. Supports streaming over server-sent events, tool use, and vision inputs via image content parts.
Body parameters
| Name | Type | Description |
|---|---|---|
modelRequired | string | ID of the model to use, e.g. prism-2-flash. |
messagesRequired | array | The conversation so far, as a list of {role, content} objects. |
temperature | number | Sampling temperature between 0 and 2. Higher is more creative. Defaults to 1. |
stream | boolean | When true, tokens are sent incrementally as server-sent events. |
tools | array | Function definitions the model may call during the completion. |
max_tokens | integer | Upper bound on the number of generated tokens. |
Responses
stream is true.Retry-After interval.Example request
curl https://api.prism.ai/v1/chat/completions \
-H "Authorization: Bearer $PRISM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "prism-2-flash",
"messages": [{ "role": "user", "content": "Summarize SSE in one line." }],
"stream": false
}'
/v1/embeddingsEncodes text into a numeric vector you can store in any vector database — for semantic search, clustering, recommendations, and RAG pipelines.
Query parameters
| Name | Type | Description |
|---|---|---|
modelRequired | string | Embedding model ID, e.g. prism-embed-3. |
inputRequired | string | array | Text to embed. Pass an array to embed a batch in a single call. |
dimensions | integer | Truncate output vectors to this size. Defaults to the model's native 1536. |
Responses
Example request
curl -G https://api.prism.ai/v1/embeddings \
-H "Authorization: Bearer $PRISM_API_KEY" \
-d "model=prism-embed-3" \
--data-urlencode "input=How do I stream responses?"
/v1/models/{id}Returns full metadata for a single model: context window, supported modalities, rate limits, and deprecation status.
Path parameters
| Name | Type | Description |
|---|---|---|
idRequired | string | The model ID, e.g. prism-2-pro. |
Responses
Example request
curl https://api.prism.ai/v1/models/prism-2-pro \
-H "Authorization: Bearer $PRISM_API_KEY"
The implementation guides cover streaming UIs, tool use loops, and resilient error handling.
Practical, production-focused walkthroughs for the patterns you'll actually ship.
The quickstart takes you from zero to your first model response in about five minutes.