Python gateway beta quickstart

VerticalAPI is a drop-in replacement for the OpenAI Python SDK. You're calling Claude, Gemini or any of 11 providers in 5 lines.

From beta docs to a verified test

  1. Read the gateway beta documentation

    Confirm current access, supported providers, compatibility and limits.

  2. Prepare scoped credentials

    Follow your provider's current key-handling guidance and avoid production credentials during evaluation.

  3. Install the Python SDK

    pip install openai

  4. Run the example below

    Use the documented base URL and required headers, then verify the returned shape for this beta path.

  5. Validate the result

    Check response shape, model behavior, limits and total cost against the provider before production.

Python — first call

quickstart.pythonPython
from openai import OpenAI

client = OpenAI(
    base_url="https://api.verticalapi.com/v1",
    api_key="vapi_...",  # your VerticalAPI key
    default_headers={"X-Provider-Key": "sk-..."}  # your provider key
)

response = client.chat.completions.create(
    model="gpt-4o",  # or claude-sonnet-4-5, gemini-2.5-pro, ...
    messages=[{"role": "user", "content": "Hello, world"}]
)
print(response.choices[0].message.content)

Model IDs and provider support can drift. Check the source-dated model directory and current beta documentation before changing the model or provider header.

Common errors and fixes

401 Unauthorized — invalid VerticalAPI key
Verify provider access, current pricing and compatibility separately before integration.
402 Provider key invalid
X-Provider-Key must match the model's provider. sk-... for OpenAI, sk-ant-... for Anthropic, AIza... for Google. VerticalAPI returns the provider's exact error code so you can debug at the source.
429 Rate limited
VerticalAPI inherits your provider account's rate limits. Slow down or upgrade the underlying provider plan. Check VerticalAPI's dashboard rate-limit panel for live status.

Where to go from here

Pick a model in the source-dated directory. Compare two in the decision comparisons. Review the benchmark evidence policy before trusting performance claims.