Migration guides

Bring your OpenAI-compatible code

The chat endpoint is OpenAI-style, so most migrations are a base URL and key swap plus one new request field. Responses-compat has a phase-1 subset you should know about before switching.

From OpenAI chat completions

Point your client at https://api.hardcarrx.com/v1, use your Hardcarrx workspace key, and add provider to each request. Everything else in the chat shape carries over.

# OpenAI SDK pointed at OpenAI
client = OpenAI()  # api.openai.com

resp = client.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[{"role": "user", "content": "Hello"}]
)
# OpenAI SDK pointed at Hardcarrx
client = OpenAI(
    base_url="https://api.hardcarrx.com/v1",
    api_key="***"
)

resp = client.chat.completions.create(
    provider="openai",        # Hardcarrx routes by provider
    model="gpt-4.1-mini",
    messages=[{"role": "user", "content": "Hello"}]
)
  • Provider credentials are stored in the dashboard — your code never holds provider keys (or send one-request provider_key; see providers).
  • provider/model identifiers like openai/gpt-4o-mini are also accepted.
  • Error handling: same status codes, one error envelope.

From OpenAI Responses API

/v1/responses accepts the text-only, non-streaming subset in its first phase. Unsupported features return 422 explicitly — they never silently degrade.

client.responses.create(model="gpt-4.1-mini", input="Hello", stream=True)
# Phase 1: non-streaming only
client.responses.create(model="gpt-4.1-mini", input="Hello")
# stream=True, tools, instructions -> 422 (explicit, no silent fallback)
  • stream: true → 422 (see streaming).
  • tools, instructions, non-text modalities → 422.
  • If the deployment has Responses compatibility disabled, the endpoint answers 404.

Checklist

  1. Create a workspace API key (hxv_…).
  2. Store provider credentials in Dashboard → Providers.
  3. Swap base URL and key in your client.
  4. Add provider (or use provider/model ids).
  5. Remove unsupported Responses features or route them to chat completions until phase 2.
  6. Verify first requests in request logs.