Skip to main content
Point your existing OpenAI or Anthropic SDK at SERV and use your SERV_API_KEY — your prompts, tool definitions, and application logic stay the same. Or call the endpoints directly over HTTP. Generate a key at console.openserv.ai.

Make your first request

Install the SDK you already use:
Then call SERV from server-side code, such as an example.mjs file. Read the key from the SERV_API_KEY environment variable and never expose it in browser JavaScript.
Both SDKs return their standard response shapes, with token counts in usage. That completes the integration. For Python, the Vercel AI SDK, LangChain, and other clients, see SDK Migration.

Call the endpoints directly

For raw HTTP, SERV exposes three endpoints under https://inference-api.openserv.ai.

Things to know

A few SERV-specific behaviors are worth knowing before your first integration. Full detail is in SDK Integration.
  • A system prompt is required. Every request needs a system message, instructions field, or developer message. Requests without one are rejected.
  • The base URL differs by SDK. The OpenAI SDK takes /v1 in the base URL; the Anthropic SDK does not — it appends /v1/messages itself.
  • The auth field differs by SDK. OpenAI uses apiKey; the Anthropic SDK uses authToken.

If the request fails

  • 401: the API key is missing, revoked, or wrong. With the Anthropic SDK, pass authToken and set apiKey: null so an ambient ANTHROPIC_API_KEY isn’t sent instead.
  • 402: the organization’s balance can’t cover the request. Add credits in the console.
  • 400: the error message names the problem, most often a missing system prompt or a model ID that isn’t in the catalog.
  • 404 with the Anthropic SDK: remove /v1 from baseURL.
More symptoms and fixes are in SDK Migration troubleshooting.

Try it in the Playground

Compare any model with and without SERV Reasoning side by side on the same prompt before you commit to an integration. → console.openserv.ai/playground

Next steps

Migrating an existing codebase? The migration prompt lets an AI coding tool do the per-call-site changes for you.

Models

The full model catalog with pricing and context windows.

SDK Integration

Endpoint details and the parameter map.

SDK Migration

Migrate Python, Vercel AI SDK, LangChain, and raw fetch clients.

Why SERV Reasoning

What you get over calling model APIs directly.