Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenAI Docs → openai-oxide

openai-oxide has 1:1 parity with the official Python SDK. Use OpenAI’s documentation as your primary reference — the same concepts, parameter names, and patterns apply.

Endpoint Mapping

OpenAI GuideRustNode.jsPython
Chat Completionsclient.chat().completions().create()client.createResponse({model, input})await client.create(model, input)
Responses APIclient.responses().create()client.createText(model, input)await client.create(model, input)
Streamingclient.responses().create_stream()client.createStream(model, input)await client.create_stream(model, input)
Function Callingclient.responses().create_stream_fc()client.createResponse({model, input, tools})await client.create_with_tools(model, input, tools)
Structured OutputResponseCreateRequest::new(model).text_format(schema)client.createResponse({model, input, text})await client.create_structured(model, input, name, schema)
Embeddingsclient.embeddings().create()via createResponse() rawvia create_raw()
Image Generationclient.images().generate()via createResponse() rawvia create_raw()
Text-to-Speechclient.audio().speech().create()via createResponse() rawvia create_raw()
Speech-to-Textclient.audio().transcriptions().create()via createResponse() rawvia create_raw()
Fine-tuningclient.fine_tuning().jobs().create()via createResponse() rawvia create_raw()
Realtime APIclient.ws_session()client.wsSession()
Assistantsclient.beta().assistants()via createResponse() rawvia create_raw()

Node.js and Python have typed helpers for the top 5 endpoints. All other endpoints work via raw JSON methods.

Parameter Names

Parameter names match the Python SDK exactly:

OpenAI PythonRustNode.js
model="gpt-5.4".model("gpt-5.4"){ model: "gpt-5.4" }
max_output_tokens=100.max_output_tokens(100){ maxOutputTokens: 100 }
temperature=0.7.temperature(0.7){ temperature: 0.7 }
stream=Truecreate_stream()createStream()
store=True.store(true){ store: true }

openai-oxide Exclusive Features

These features are not available in the official SDKs:

FeatureAPIDescription
WebSocket Sessionsclient.ws_session()Persistent connection, 37% faster agent loops
Hedged Requestshedged_request()Race redundant requests, cut P99 latency
Stream FC Early Parsecreate_stream_fc()Execute tools 400ms before response finishes
SIMD JSONfeatures = ["simd"]AVX2/NEON accelerated parsing
WASMdefault-features = falseFull streaming in Cloudflare Workers