Prism AI Docs
Abstract 3D render visualizing artificial intelligence and neural networks in digital form
Prism AI · Developer Platform

Build with the Prism AI API

One clean REST API for chat, embeddings, vision, and tool use — with official SDKs for Python and JavaScript, transparent usage, and production-grade reliability.

99.95% uptime 4 model families SOC 2 Type II

Key capabilities

Everything you need to ship AI features, behind one key.

Laptop displaying code with reflection, perfect for tech and programming themes

Text generation

Draft, summarize, translate, and converse with the Prism-2 model family.

Modern digital spheres interconnected by glowing lines, showcasing a futuristic network

Embeddings & search

Turn text into vectors for semantic search, clustering, and RAG pipelines.

A digitally rendered abstract image showcasing a futuristic eye with complex network patterns

Vision

Understand images, screenshots, charts, and documents out of the box.

Close-up view of a motherboard with visible electronic components and connectors

Tool use

Let models call your functions and APIs with typed, validated arguments.

Documentation

Start here, then go deeper.

Quickstart

Make your first API call in about five minutes — install the SDK, configure a key, and get a model response back.

1Install the SDK

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

2Configure your API key

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.

bash
# macOS / Linux
export PRISM_API_KEY="pk_live_51NxT…"
Keep it secret. Never commit keys to source control — use environment variables locally and a secrets manager in production.

3Make your first request

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:

Response · 200 OK
{
  "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 }
}
You're up and running.

Every endpoint, parameter, and response shape is documented in the API reference.

Explore API endpoints

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

GET/v1/models

Returns the models available to your workspace, including context window, supported modalities, and pricing tier. Results are sorted by release date, newest first.

Query parameters

NameTypeDescription
limitintegerMaximum number of models to return. Defaults to 20, max 100.
afterstringPagination cursor from a previous response.

Responses

  • 200 OKA paginated list of model objects.
  • 401 UnauthorizedMissing or invalid API key.

Example request

bash
curl https://api.prism.ai/v1/models \
  -H "Authorization: Bearer $PRISM_API_KEY"

POST/v1/chat/completions

Generates 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

NameTypeDescription
modelRequiredstringID of the model to use, e.g. prism-2-flash.
messagesRequiredarrayThe conversation so far, as a list of {role, content} objects.
temperaturenumberSampling temperature between 0 and 2. Higher is more creative. Defaults to 1.
streambooleanWhen true, tokens are sent incrementally as server-sent events.
toolsarrayFunction definitions the model may call during the completion.
max_tokensintegerUpper bound on the number of generated tokens.

Responses

  • 200 OKA chat completion object — or an SSE stream when stream is true.
  • 401 UnauthorizedMissing or invalid API key.
  • 429 Too Many RequestsRate limit exceeded — retry after the Retry-After interval.

Example request

bash
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
      }'

GET/v1/embeddings

Encodes text into a numeric vector you can store in any vector database — for semantic search, clustering, recommendations, and RAG pipelines.

Query parameters

NameTypeDescription
modelRequiredstringEmbedding model ID, e.g. prism-embed-3.
inputRequiredstring | arrayText to embed. Pass an array to embed a batch in a single call.
dimensionsintegerTruncate output vectors to this size. Defaults to the model's native 1536.

Responses

  • 200 OKA list of embedding vectors, one per input.
  • 401 UnauthorizedMissing or invalid API key.

Example request

bash
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?"

GET/v1/models/{id}

Returns full metadata for a single model: context window, supported modalities, rate limits, and deprecation status.

Path parameters

NameTypeDescription
idRequiredstringThe model ID, e.g. prism-2-pro.

Responses

  • 200 OKA single model object.
  • 404 Not FoundNo model exists with the given ID.

Example request

bash
curl https://api.prism.ai/v1/models/prism-2-pro \
  -H "Authorization: Bearer $PRISM_API_KEY"
Go beyond single calls.

The implementation guides cover streaming UIs, tool use loops, and resilient error handling.

Read implementation guides

Developer Guides

Practical, production-focused walkthroughs for the patterns you'll actually ship.

New to the Prism API?

The quickstart takes you from zero to your first model response in about five minutes.

Follow the quickstart
Copied to clipboard