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/modelidentifiers likeopenai/gpt-4o-miniare 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
- Create a workspace API key (
hxv_…). - Store provider credentials in Dashboard → Providers.
- Swap base URL and key in your client.
- Add
provider(or useprovider/modelids). - Remove unsupported Responses features or route them to chat completions until phase 2.
- Verify first requests in request logs.