Skip to main content
vLLM workers implement OpenAI API compatibility, so you can use OpenAI client libraries with your deployed models. To integrate with OpenAI-compatible tools, just configure the base URL and API key using your Runpod API key and Serverless endpoint ID.

Setup

Replace ENDPOINT_ID and RUNPOD_API_KEY with your actual values.

Supported endpoints

Chat completions

For instruction-tuned models that follow a chat format.

Text completions

For base models and raw text completion.

Model name

The model parameter must match either:
  • The Hugging Face model you deployed (e.g., mistralai/Mistral-7B-Instruct-v0.2)
  • A custom name set via the OPENAI_SERVED_MODEL_NAME_OVERRIDE environment variable
List available models:

Parameters

Standard OpenAI parameters are supported. Include them directly in your request.

Environment variables

Use these environment variables to customize the OpenAI compatibility: See environment variables reference for all options.

Differences from OpenAI

  • Token counting may differ due to different tokenizers.
  • Rate limits follow Runpod’s policies, not OpenAI’s.
  • Function/tool calling depends on model and vLLM support.
  • Vision/multimodal depends on underlying model support.

Troubleshooting