Skip to main content
Piramyd implements the OpenAI REST API specification, which means any code you’ve already written against the OpenAI Python or JavaScript SDK works against Piramyd without modification — you only need to point the client at a different base URL and swap in your Piramyd API key. You gain access to models from multiple upstream providers (Anthropic, OpenAI, and others) through a single, familiar interface.

What’s Compatible

Piramyd supports the following OpenAI-compatible endpoints and features: In addition to the endpoints above, the following features are fully supported:
  • Streaming SSE — set stream: true on any chat completions request
  • stream_options: {include_usage: true} — receive token counts in the final streaming chunk
  • Tool calling — define functions and let the model decide when to invoke them
  • Vision — pass image URLs or base64-encoded images in message content arrays

Model IDs

Piramyd’s catalog changes as new models are added and deprecated. Rather than hardcoding a model ID that may become unavailable, always discover models at runtime using GET /v1/models.
Model ID normalization — Piramyd accepts model IDs in multiple formats and resolves them to the same model. All three of the following are equivalent:
The API normalizes IDs case-insensitively and accepts provider-prefixed as well as OpenRouter-style IDs. Use whatever format your tooling produces.

Compatibility Redirects

A small set of non-versioned paths redirect with HTTP 307 (preserving the POST body) to their /v1/ counterparts: These redirects exist for convenience only. Always call /v1/ paths directly in production code — relying on redirects adds an unnecessary round trip.
Call GET /v1/models at application startup and cache the result for the lifetime of your process. Check supports_tools, supports_vision, and context_length before building requests — these fields vary by model and can save you a wasted inference call.