Prismatic API/Docs/OpenAI SDK
Documentation

OpenAI SDK

Use Prismatic with the official OpenAI JavaScript and Python SDKs by overriding the base URL.

Configuration

  • Install the official openai package in your application.
  • Set PRISMATIC_API_KEY server-side and map it to OPENAI_API_KEY if the SDK expects that variable.
  • Set the SDK baseURL / base_url to https://api.prismaticapi.com/v1.
  • Use any public model ID returned by GET /v1/models.

Example

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.PRISMATIC_API_KEY,
  baseURL: "https://api.prismaticapi.com/v1"
});

const completion = await client.chat.completions.create({
  model: "claude-sonnet-4-6",
  messages: [{ role: "user", content: "Write three product taglines." }],
  max_tokens: 400
});
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PRISMATIC_API_KEY"],
    base_url="https://api.prismaticapi.com/v1",
)

completion = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Write three product taglines."}],
    max_tokens=400,
)

Recommended models

  • claude-sonnet-4-6 — strong model for reasoning, refactors and coding agents.
  • claude-haiku-4-5 — fast option for autocomplete, small questions and lightweight tasks.
  • deepseek-v3-2 or another public ID — alternative based on your active catalog and plan.

Troubleshooting

Authentication error

Check that the API key has no extra spaces and has not been revoked in the dashboard.

Model rejected

Use a public model ID returned by GET /v1/models; do not use labels or aliases.

Connection issue

Confirm the configured base URL is exactly the one shown above and that your network allows HTTPS to api.prismaticapi.com.

Notes

  • /v1/chat/completions, /v1/responses and /v1/models use the OpenAI-compatible surface.
  • Keep the key out of browser code and mobile clients.
  • Streaming works when the SDK request sets stream: true.