Use your GENGEN API key and the OpenAI SDK with https://gengen.farm/v1.
This page covers chat, tool execution, supporting resources and conversation state
for gpt-6.1-sol, gpt-6-astra, gpt-6-sol and gpt-6-luna.
Interface
Endpoint
Use it for
Chat Completions
POST /v1/chat/completions
Existing chat clients, text/image messages, structured output and supported function calls.
Responses
POST /v1/responses
Full tool workflows, Code Interpreter, File Search, image generation, stored conversations and background work.
Both interfaces also support the /api/gengen/v1 prefix. Tool features belong
to the chat workflow, but hosted tools require Responses. Adding them to a
Chat Completions request does not enable them.Paid synchronous text requests, including context compaction, require at least USD 2.00 in credits available for the model. GENGEN checks the balance before sending the request and charges actual usage when it finishes. Concurrent requests can leave the wallet with a negative balance. Hosted tools, stored responses and background work use separate reservations.
Model discovery and Codex setup
GET https://gengen.farm/v1/models lists the public chat models, including the
four GPT models, in OpenAI-compatible object: "list" / data format. Send your
GENGEN API key as Authorization: Bearer YOUR_GENGEN_API_KEY. The same endpoint
is available at /api/gengen/v1/models. Listing models is free and does not
require a positive wallet balance.
The OpenAI SDK also supports client.models.list(). Each entry contains id,
object: "model", created (0 when the creation time is unavailable), and
owned_by. The list contains chat models only; it excludes media-only models.
Model availability does not imply identical tool support on both interfaces.For CC Switch with Codex, select the Responses upstream format, set the API
base URL to https://gengen.farm/v1, enter your GENGEN API key, and fetch the model
list. Select gpt-6.1-sol (or another GPT model), save, and restart Codex. Do not
select Chat Completions conversion for reasoning/tool workflows; use Responses
to preserve native tool calls and reasoning history.Use HTTP Responses/SSE for this custom provider. Disable Fast/Priority mode;
GENGEN uses Standard processing, including when service_tier is auto or
omitted. Nullable optional settings are treated as omitted. Legacy user values
are scoped to the authenticated caller, like cache and safety identifiers.
Only the standard access program is available; elevated access programs and
inline moderation are not supported.
The response uses native choices and usage. messages, image content parts,
response_format, max_completion_tokens, reasoning_effort, cache settings
and metadata retain their native shapes. store is always false and n must
be 1. Use max_completion_tokens to bound visible and reasoning output together.
The response uses native id, object: "response", status, model,
output and usage. Read every output item: reasoning, messages, tool calls,
citations, refusals and approval requests can appear together. The SDK’s
output_text helper collects text items. Examples below use this Python client.
Models and reasoning
Model
Reasoning efforts
Chat Completions tools
gpt-6.1-sol
low, medium, high, xhigh, max
Use Responses
gpt-6-astra
low, medium, high, xhigh, max
Use Responses
gpt-6-sol
none, low, medium, high, xhigh, max
Functions with reasoning_effort: "none"
gpt-6-luna
none, low, medium, high, xhigh, max
Functions with reasoning_effort: "none"
All four default to medium, accept text and images, and support structured text
output. Their context window is 1,050,000 tokens, with up to 922,000 input tokens
and 128,000 output tokens including reasoning. Use background: true for long tasks. Hosted foreground requests that exceed
the HTTP budget return HTTP 202 with a Location header for continued polling.Sampling and log-probability controls require reasoning effort none on Sol/Luna.
Omit them for Sol 6.1 and Astra. Chat function tools and tool-result history also
require reasoning_effort: "none" on Sol/Luna; the other models require Responses
for tool calling.
Images, files, and structured output
In Responses, use native input_image parts with HTTPS or data URLs. Files accept input_file
with an owned file_id, file_url, or filename plus Base64 file_data.
POST /files accepts native multipart uploads. The existing JSON Blob upload
protocol remains available for media utilities. See Files and resource management.Use text.format for json_object or strict json_schema output. instructions,
reasoning.summary, text.verbosity, include, truncation, metadata and prompt
cache options pass through. temperature, top_p and log probabilities require
reasoning.effort: "none" on Sol/Luna; omit them for the other models.
Responses and tools
Declare tools in client.responses.create(tools=[...]). For example:
response = client.responses.create( model="gpt-6.1-sol", input="Research recent developments in battery recycling and cite sources.", tools=[{"type": "web_search"}], max_output_tokens=4096, store=False,)print(response.output_text)
Tool type
Execution and requirements
function
Your application executes calls and submits function_call_output with the original call_id. Supports strict schemas and parallel calls.
custom
Your application executes calls and returns custom_tool_call_output; text and grammar formats pass through.
Supply your own HTTPS server_url, optional authorization, tool filters, and require_approval. Preserve approval requests and submit mcp_approval_response explicitly. Shared connectors are unavailable.
computer, computer_use_preview
Your application executes computer actions and returns screenshots and safety acknowledgements.
shell
Local execution uses environment: {"type":"local"}. Hosted execution uses container_auto or an owned container_reference; inline and supported first-party skills can be mounted.
code_interpreter
OpenAI executes Python in an automatic container or a container created by this API key.
file_search
Searches vector stores created by this API key. Filters, citations and search-result inclusion pass through.
image_generation
Generates or edits images with the three supported GPT Image models; returns native image items, formats and partial-image events.
apply_patch
Your application applies requested changes and returns apply_patch_call_output.
tool_search
Tool search declarations and results pass through. Client search must return valid function/custom declarations.
Tool declarations, tool_choice, parallel_tool_calls, max_tool_calls, custom
arguments, approval decisions, and tool result items retain their native shapes.
The API does not execute client tools or acknowledge safety checks on your behalf.
See Function calling for application execution patterns.
Tool examples
Function calling and reasoning replay
For stateless conversations, preserve all output items, including
encrypted reasoning, and return a result for every call before continuing:
tools = [{ "type": "function", "name": "get_weather", "description": "Get the weather for a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"], "additionalProperties": False, }, "strict": True,}]history = [{"role": "user", "content": "What is the weather in Paris?"}]while True: response = client.responses.create( model="gpt-6.1-sol", input=history, tools=tools, include=["reasoning.encrypted_content"], store=False, ) if response.status != "completed": raise RuntimeError(f"Generation ended with {response.status}") history.extend(response.output) calls = [item for item in response.output if item.type == "function_call"] if not calls: print(response.output_text) break for call in calls: # Validate arguments and execute your application function here. history.append({"type": "function_call_output", "call_id": call.call_id, "output": '{"temperatureC":22,"conditions":"clear"}'})
Native multipart uploads support assistants, user_data and vision. The
multipart body, including the file and fields, must fit within 4 MB. Files
expire seven days after creation. HTTPS file URLs can supply larger model inputs when the upstream supports the
format; inline data must still fit the HTTP request limits. Resumable OpenAI
Uploads and arbitrary global file discovery are not provided. The existing JSON
Blob media-upload protocol on /files remains supported.Vector stores reserve up to 1 GB of capacity for 24 hours from creation.
Creation purchases this fixed capacity period; deleting early does not refund the
reservation. Activity does not extend it. Retrieval monitors the size, and the
cleanup service removes stores that exceed capacity or reach expiry. Create a new
store for another period. File indexing is asynchronous: poll before searching.Supported operations include owned list/create/retrieve/delete; vector-store
name, description and metadata updates; attach/list/retrieve/update/delete files;
create/retrieve/cancel file batches and list batch files; and POST /vector_stores/{id}/search.
Use at most twenty file IDs per create/attach-batch request. Root resource lists
are scoped metadata snapshots; retrieve a resource for live upstream status.File content downloads remain subject to upstream restrictions for the file’s
purpose; an uploaded input document may be unavailable for download even when it
can be indexed and searched. Keep the original document in your application.
Use the container file content endpoint to download Code Interpreter artifacts.
Code Interpreter and hosted shell
response = client.responses.create( model="gpt-6-luna", input="Use Python to calculate the mean of 17, 23 and 41.", tools=[{"type": "code_interpreter", "container": {"type": "auto", "memory_limit": "1g"}}], store=True,)print(response.output_text)
For explicit container management:
container = client.containers.create(name="analysis", memory_limit="1g", extra_headers={"Idempotency-Key": "analysis-container-1"})response = client.responses.create( model="gpt-6-sol", input="Run a shell command to list the available input files.", tools=[{"type": "shell", "environment": { "type": "container_reference", "container_id": container.id }}], store=True,)client.containers.delete(container.id)
Code Interpreter also accepts an owned container ID string. Hosted shell supports
container_auto and container_reference; local shell remains application-executed.
Containers support 1, 4, 16 and 64 GB memory, owned input file IDs, native network
policies, inline skills and supported first-party skills. Shared custom skill IDs
are unavailable. First-party skill access depends on upstream availability.A new container purchases one session. GENGEN’s fixed deadline is 19 minutes
from upstream creation, within the provider’s twenty-minute session window;
activity does not renew it. A reference with less than five minutes remaining is
rejected so you can create a new session. A reused owned container is not charged
again within its session. Download artifacts before expiry using
GET /containers/{id}/files/{fileId}/content. Container file upload, list,
retrieve and delete endpoints are available. Containers are temporary sandboxes,
not persistent storage.
Image generation during chat
response = client.responses.create( model="gpt-6-luna", input="Draw a tiny orchard logo on a white background.", tools=[{"type": "image_generation", "model": "gpt-image-2.5-flare", "size": "1024x1024", "quality": "low"}], store=True,)images = [item for item in response.output if item.type == "image_generation_call"]# Each completed image item contains native Base64 result data.
For 2.6, use native tool fields complexity, output_format, frame_count, and frame_duration_ms. GIF output is priced by megapixels across all frames. SVG includes the service price for its rendered reference and the measured author tokens. The native tool returns Base64 output. Use the Image API for markup-guided edits or hosted output URLs.For SVG, tools[].svg.model is optional. With SVG author selection enabled, omit it to use the outer Responses model. For example, "svg": {"reasoning": {"effort": "low"}} sets only the author’s effort. An explicit author override uses that author’s supported efforts. Without author selection, OpenAI uses its default author and does not accept a model override. See the OpenAI Responses reference.The image models are gpt-image-2.6-flare, gpt-image-2.6-sunburst, gpt-image-2.5-flare, gpt-image-2.5-sunburst and
gpt-image-2. Defaults are GPT Image 2.5 Flare, 1024x1024 (or auto for GIF), and medium. Native rendering,
background, output format/compression, editing and partial-image options pass
through. Sizes may be auto or dimensions divisible by sixteen, within a 1:3 to
3:1 aspect ratio and the model’s maximum of 3840×2160 pixels. Flare and Sunburst
also accept xhigh and max quality. Provider-specific size constraints still
apply. Previous response IDs and owned image item references enable iterative edits.Image tools use a fixed GENGEN image service price per output megapixel and
quality, plus the parent model’s measured tokens. This differs from the dedicated
image endpoint’s token pricing. The upstream image tool does not expose complete
independent image token usage; GENGEN does not invent it or claim an exact upstream
image cost. Check current final service prices before generating.For a standalone image request without a GPT conversation, use the
Image API.
Files and resource management
Files, containers and vector stores support chat tools through separate resource
endpoints. Resources belong to the creating account, workspace and API key;
use that same key for subsequent requests. IDs from OpenAI directly or another
GENGEN key are unavailable. Root lists return scoped metadata snapshots; retrieve
a resource for its live status.
Resource
Endpoints and supported operations
Files
/v1/files: upload/list; /v1/files/{id}: retrieve/delete; /v1/files/{id}/content: download where the upstream purpose permits.
Containers
/v1/containers: create/list; /v1/containers/{id}: retrieve/delete; /v1/containers/{id}/files and nested file/content routes: upload, attach, list, retrieve, download and delete artifacts.
Vector stores
/v1/vector_stores: create/list; /v1/vector_stores/{id}: retrieve/update/delete; nested files, file_batches and search routes: index files, manage attributes, poll/cancel indexing batches and search.
Set store: true to retain a response. Once it has finalized, pass its ID in
previous_response_id to continue the conversation with the same key and workspace:
first = client.responses.create( model="gpt-6-luna", input="Remember that the project name is Orchard.", store=True,)if first.status != "completed": raise RuntimeError("Finalize the first response before continuing.")followup = client.responses.create( model="gpt-6-luna", input="What is the project name?", previous_response_id=first.id, store=True,)print(followup.output_text)
Plain requests default to stateless execution. Hosted tools and owned resource
references use durable execution and default to store: true. Explicit
store: false retains recovery state for at most ten minutes. Only a finalized
stored response can be used as previous_response_id.
import timeresponse = client.responses.create( model="gpt-6-astra", input="Analyze the attached research thoroughly.", background=True, store=True, max_output_tokens=8192, extra_headers={"Idempotency-Key": "research-run-1"},)while response.status in ("queued", "in_progress"): time.sleep(2) response = client.responses.retrieve(response.id)print(response.status)# To cancel active work: client.responses.cancel(response.id)# To remove a finalized response: client.responses.delete(response.id)
Responses keep native IDs and snake_case fields. Stored responses expire after
thirty days; explicit store: false permits a ten-minute recovery window. Stored
previous responses must be finalized before reuse. GET /responses/{id}/input_items
is supported. Long foreground hosted calls may return HTTP 202 with a Location
header; continue polling that response ID.Set both background: true and stream: true to receive native SSE and later
resume with GET /responses/{id}?stream=true&starting_after={sequenceNumber}.
Sequence numbers and tool events retain their native shape. Only a response
originally created with streaming can be resumed this way. A disconnect leaves
hosted work running; cancel explicitly. Usage proven before cancellation remains
billable. Wallet settlement precedes terminal events and terminal retrieval.
Long conversations and compaction
To enable server-side compaction during generation, add
context_management: [{"type": "compaction", "compact_threshold": 200000}] to a
Responses request. At most one entry is supported; an explicit threshold must
be an integer of at least 1000 tokens. Preserve encrypted compaction items in
conversation history just like other native output items.For explicit compaction, use POST /v1/responses/compact:
The compact endpoint returns a native response.compaction object with id,
created_at, output, and usage. Pass the complete output into the next
request. It supports instructions, caller-scoped prompt-cache settings, and an
owned, stored, settled previous_response_id. It does not stream or execute tools.
Compaction uses the model’s token prices and requires wallet balance; settlement
finishes before the compacted window is returned. Retained historical tool calls
are not charged again. If submission is ambiguous, do not automatically repeat it.
Streaming and billing
Set stream: true to receive native typed SSE events, including text, reasoning
summaries, tool argument deltas, citations, approvals and tool status events.
Responses ends with response.completed, response.incomplete, response.failed, or response.cancelled; it does not use Chat Completions’ [DONE] marker.Responses accepts stream_options: {"include_obfuscation": false} with
stream: true, including requests from Codex through CC Switch. This native
option controls the upstream stream’s padding fields and is passed through
unchanged. Omit it to keep the upstream default; null and an empty object are
also accepted. Codex’s reasoning_summary_delivery: "sequential_cutoff" and
boolean include_usage are accepted as compatibility hints and consumed locally.
They are not forwarded to the public upstream API: summary delivery follows
native SSE behavior and Responses usage still comes from terminal events.Wallet settlement finishes before the terminal event is delivered. A local
transport or settlement failure emits event: error and closes without a successful
terminal event. Treat deltas as provisional. Disconnects do not automatically
resubmit work. Requests with ambiguous provider acceptance retain their reservation
for reconciliation.Measured input, cached input, cache writes, and output are billed separately.
Reasoning tokens are already included in output tokens. Web search has an
additional per-call charge; retrieved content tokens are included in model usage.
Prompts above 272,000 input tokens use the long-context price for the full request.
Check Pricing for current final customer prices.Chat Completions uses native text/function-argument deltas and ends with [DONE].
Usage is requested upstream even if stream_options.include_usage was false.
Finish/usage chunks and [DONE] follow wallet settlement; a billing failure emits
an error without [DONE]. The same measured token rates and reconciliation rules
apply to both interfaces.GET /v1/openai/pricing returns current final USD service prices for tools,
images, container sessions and vector capacity. Model token rates are listed on
Pricing. File upload/download/list and resource retrieval/deletion have
no additional generation fee. File-search calls and direct vector searches have a
per-call fee, separate from vector capacity and model input/output tokens.Generation reserves wallet balance before upstream submission, then captures the
measured token/tool charge and releases unused funds. Tool limits default to five
and accept one to twenty; hosted output defaults to 4096 tokens. Dedicated resource
fees use the openai-hosted-resources billing service and cannot consume credits
restricted to a GPT generation model. There is a per-account quota of one hundred
active root resources and twenty unsettled operations.Send a stable Idempotency-Key for every create or paid operation. Retrying the
same key and payload returns the existing result; another payload returns HTTP
409. A lost upstream submission receipt is retained for reconciliation and never
repeated automatically. Retry with the same key and contact support if it remains
unresolved; changing the key may create another paid operation.
Availability boundaries
Only Standard processing (service_tier: "default") is exposed. Conversation IDs,
stored prompt IDs, shared upstream connectors, arbitrary upstream resource IDs,
Realtime, Assistants, Batch and WebSocket sessions remain outside this interface.
Audio/video input is not supported by these GPT models. Client-side functions,
computer actions, patches and local shell commands remain application-executed.Unsupported options and unowned references are rejected before wallet admission.
Tool access still depends on the configured upstream project’s model permissions.
Authorizations
Authorization
string
header
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
model
enum<string>
required
Available options:
gpt-6.1-sol,
gpt-6-astra,
gpt-6-sol,
gpt-6-luna
messages
object[]
required
Minimum array length: 1
max_completion_tokens
integer | null
Required range: 1 <= x <= 128000
max_tokens
integer | null
deprecated
Required range: 1 <= x <= 128000
reasoning_effort
enum<string> | null
default:medium
Available options:
none,
low,
medium,
high,
xhigh,
max,
null
tools
object[]
Function declarations only on Sol/Luna with reasoning_effort none.
tool_choice
stringobject
functions
object[]
deprecated
function_call
stringobject
deprecated
parallel_tool_calls
boolean | null
response_format
object | null
stream
boolean | null
default:false
stream_options
object | null
temperature
number | null
Requires reasoning_effort none.
top_p
number | null
Requires reasoning_effort none.
logprobs
boolean | null
Requires reasoning_effort none.
top_logprobs
integer | null
Requires reasoning_effort none.
presence_penalty
number | null
frequency_penalty
number | null
stop
stringstring[]
seed
integer | null
n
enum<integer> | null
Available options:
1,
null
metadata
object | null
Show child attributes
user
string | null
Legacy identifier, hashed in caller scope.
safety_identifier
string | null
prompt_cache_key
string | null
prompt_cache_options
object
prompt_cache_retention
string | null
service_tier
enum<string> | null
Auto and omission use Standard processing.
Available options:
auto,
default,
null
store
enum<boolean> | null
Available options:
false
Response
Native Chat Completion or SSE chunks. Finish/usage chunks and DONE follow wallet settlement.
id
string
required
choices
object[]
required
usage
object
required
object
any
model
string
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"GENGEN API","description":"Build video, image, and multimodal applications with the GENGEN API.","colors":{"primary":"#007F7C","light":"#05FFFB","dark":"#007F7C"},"logo":{"light":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo-light.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=44296f0917d75c0ed5aa05513ec6c402","dark":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=e575f6379e1249d846c63539492c6b94","href":"https://gengen.farm"},"favicon":"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/favicon.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=32c70fe233096e49352a91ec312e3193","api":{"params":{"expanded":"closed"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript"]}},"appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[{"href":"https://gengen.farm/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://gengen.farm/dashboard"}},"seo":{"indexing":"navigable"},"icons":{"library":"lucide"},"styling":{"eyebrows":"section","codeblocks":"dark","latex":false},"contextual":{"options":["copy","view"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apifarm","hasAudioNarration":false,"actualSubdomain":"apifarm","customDomains":["docs.gengen.farm"],"gitSource":{"type":"github","owner":"sprout-technologies","repo":"apifarm","deployBranch":"main","contentDirectory":"mintlify","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b001407ff5bb0c4681a8975","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Models","count":138},{"language":"default","tag":"API Reference","count":111},{"language":"default","tag":"ElevenLabs","count":30},{"language":"default","tag":"Video","count":29},{"language":"default","tag":"BytePlus","count":23},{"language":"default","tag":"Video API","count":23},{"language":"default","tag":"LLM","count":19},{"language":"default","tag":"Image","count":17},{"language":"default","tag":"Help","count":14},{"language":"default","tag":"Assets API","count":13}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".gengen-model-unavailable{color:#007f7c}html.dark .gengen-model-unavailable,html[data-theme=\"dark\"] .gengen-model-unavailable{color:#05fffb}main div.whitespace-pre-wrap.prose-sm.mt-6:has(>.inline-block>code){display:none}html.dark #navbar a[href=\"https://gengen.farm/dashboard\"],html[data-theme=\"dark\"] #navbar a[href=\"https://gengen.farm/dashboard\"]{color:#000000!important}html.dark #navbar a[href=\"https://gengen.farm/dashboard\"] *,html[data-theme=\"dark\"] #navbar a[href=\"https://gengen.farm/dashboard\"] *{color:#000000!important}@media (min-width: 1280px){body:has(#gengen-pricing-page) #content-container>div:has(>#content-area){gap:24px}body:has(#gengen-pricing-page) #content-area{flex:1 1 0%;width:0;min-width:0}body:has(#gengen-pricing-page) #content-side-layout{flex:0 0 176px;max-width:176px}body:has(#gengen-pricing-page) #table-of-contents-layout{width:100%;padding-left:16px}body:has(#gengen-pricing-page) #table-of-contents{width:100%}}.gengen-pricing{--pricing-text: #18181b;--pricing-muted: #71717a;--pricing-border: #e4e4e7;--pricing-header: #fafafa;--pricing-accent: #007f7c}html.dark .gengen-pricing,html[data-theme=\"dark\"] .gengen-pricing{--pricing-text: #ffffff;--pricing-muted: #a1a1aa;--pricing-border: #27272a;--pricing-header: #111113;--pricing-accent: #05fffb}.gengen-pricing-recommendations{padding-bottom:16px}.gengen-pricing .gengen-pricing-recommendations h2{margin:0;color:var(--pricing-text);font-size:20px;font-weight:600;line-height:28px}.gengen-pricing .gengen-pricing-recommendations-description{margin:6px 0 16px;color:var(--pricing-muted);font-size:13px;line-height:20px}.gengen-pricing-recommendation-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(min(100%, 240px), 1fr));gap:12px}.gengen-pricing-recommendation{display:flex;flex-direction:column;min-width:0;padding:16px;border:1px solid var(--pricing-border);border-radius:8px;background:var(--pricing-header)}.gengen-pricing-offer{display:flex;flex:1;flex-direction:column;gap:16px}.gengen-pricing-offer+.gengen-pricing-offer{margin-top:16px;padding-top:16px;border-top:1px solid var(--pricing-border)}.gengen-pricing .gengen-pricing-offer-models{margin:0;padding:0;color:var(--pricing-text);list-style:none;font-size:14px;font-weight:500;line-height:22px}.gengen-pricing .gengen-pricing-offer-models li{margin:0;padding:0}.gengen-pricing-offer-saving{margin-top:auto}.gengen-pricing-offer-discount{color:var(--pricing-accent);font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;line-height:32px;overflow-wrap:anywhere}.gengen-pricing-offer-standard{color:var(--pricing-muted);font-size:18px}.gengen-pricing-groups{display:grid;gap:12px}.gengen-pricing-group{min-width:0;overflow:hidden;border:1px solid var(--pricing-border);border-radius:8px}.gengen-pricing .gengen-pricing-group-heading{margin:0;font-size:16px;line-height:24px}.gengen-pricing-group-toggle{scroll-margin-top:128px;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:16px 20px;color:inherit;background:var(--pricing-header);text-align:left;font:inherit;font-weight:600;cursor:pointer}.gengen-pricing-group-toggle:hover{color:var(--pricing-accent)}.gengen-pricing-group-count{margin-left:auto;color:var(--pricing-muted);font-size:12px;font-weight:400;white-space:nowrap}.gengen-pricing-group-chevron{flex:0 0 16px;width:16px;height:16px}.gengen-pricing-group-toggle[aria-expanded=\"true\"] .gengen-pricing-group-chevron{transform:rotate(90deg)}.gengen-pricing-group>div[hidden]{display:none}.gengen-pricing-group .gengen-pricing-model{border-top:1px solid var(--pricing-border)}.gengen-pricing-model{min-width:0}.gengen-pricing-model-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:20px}.gengen-pricing-model-header h3{margin:0}.gengen-pricing-model-header select{min-height:40px}.gengen-pricing-scroll-hint{display:none}.gengen-pricing-scroll{overflow-x:auto;overscroll-behavior-x:contain}.gengen-pricing .gengen-pricing-table{width:100%;min-width:680px;margin:0;border-collapse:collapse;table-layout:fixed;font-size:13px;line-height:20px}@media (min-width: 1024px){.gengen-pricing .gengen-pricing-table{min-width:0}}.gengen-pricing-table thead{background:var(--pricing-header)}.gengen-pricing .gengen-pricing-table th,.gengen-pricing .gengen-pricing-table td{padding:14px 16px;border:0;border-top:1px solid var(--pricing-border);text-align:left;vertical-align:middle}.gengen-pricing .gengen-pricing-table thead th{color:var(--pricing-muted);font-size:12px;font-weight:500}.gengen-pricing .gengen-pricing-table tbody th{font-weight:400}.gengen-pricing-table th:nth-child(1){width:22%}.gengen-pricing-table th:nth-child(2){width:28%}.gengen-pricing-table th:nth-child(3){width:19%}.gengen-pricing-table th:nth-child(4){width:12%}.gengen-pricing-table th:nth-child(5){width:19%}.gengen-pricing-number{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.gengen-pricing-estimate,.gengen-pricing-table td:nth-child(3) .gengen-pricing-number,.gengen-pricing-table td:nth-child(5) .gengen-pricing-number{color:var(--pricing-accent);font-weight:600;white-space:nowrap}.gengen-pricing-rate{display:flex;flex-direction:column;gap:4px}.gengen-pricing-discount{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--pricing-muted);font-size:11px;font-variant-numeric:tabular-nums}.gengen-pricing-discount>span{border-radius:4px;padding:0 5px;background:rgba(5, 255, 251, 0.08);color:var(--pricing-accent)}.gengen-pricing-muted,.gengen-pricing-unit,.gengen-pricing-quantity-unit{color:var(--pricing-muted)}.gengen-pricing-quantity-unit{display:block;font-size:11px}.gengen-pricing :focus-visible{outline:1px solid var(--pricing-accent);outline-offset:-2px}@media (max-width: 640px){.gengen-pricing-scroll-hint{display:block;color:var(--pricing-muted);font-size:12px}.gengen-pricing-model-header{padding:16px}}"}]}
{"page":{"pagePath":"api-reference/openai/chat-completions","slug":"/api-reference/openai/chat-completions","pageMetadata":{"title":"Chat","sidebarTitle":"Chat","description":"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.","openapi":"openapi/openai-llm.yaml POST /chat/completions","href":"/api-reference/openai/chat-completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,CodeBlock,Heading,Tab,Table,Tabs}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use your GENGEN API key and the OpenAI SDK with `,_jsx(_components.code,{children:`https://gengen.farm/v1`}),`.\nThis page covers chat, tool execution, supporting resources and conversation state\nfor `,_jsx(_components.code,{children:`gpt-6.1-sol`}),`, `,_jsx(_components.code,{children:`gpt-6-astra`}),`, `,_jsx(_components.code,{children:`gpt-6-sol`}),` and `,_jsx(_components.code,{children:`gpt-6-luna`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Interface`}),_jsx(_components.th,{children:`Endpoint`}),_jsx(_components.th,{children:`Use it for`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Chat Completions`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/chat/completions`})}),_jsx(_components.td,{children:`Existing chat clients, text/image messages, structured output and supported function calls.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Responses`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/responses`})}),_jsx(_components.td,{children:`Full tool workflows, Code Interpreter, File Search, image generation, stored conversations and background work.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Both interfaces also support the `,_jsx(_components.code,{children:`/api/gengen/v1`}),` prefix. Tool features belong\nto the chat workflow, but hosted tools require `,_jsx(_components.strong,{children:`Responses`}),`. Adding them to a\nChat Completions request does not enable them.`]}),`\n`,_jsxs(_components.p,{children:[`Paid synchronous text requests, including context compaction, require at least `,_jsx(_components.strong,{children:`USD 2.00`}),` in credits available for the model. GENGEN checks the balance before sending the request and charges actual usage when it finishes. Concurrent requests can leave the wallet with a negative balance. Hosted tools, stored responses and background work use separate reservations.`]}),`\n`,_jsx(Heading,{level:`2`,id:`model-discovery-and-codex-setup`,children:`Model discovery and Codex setup`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET https://gengen.farm/v1/models`}),` lists the public chat models, including the\nfour GPT models, in OpenAI-compatible `,_jsx(_components.code,{children:`object: \"list\"`}),` / `,_jsx(_components.code,{children:`data`}),` format. Send your\nGENGEN API key as `,_jsx(_components.code,{children:`Authorization: Bearer YOUR_GENGEN_API_KEY`}),`. The same endpoint\nis available at `,_jsx(_components.code,{children:`/api/gengen/v1/models`}),`. Listing models is free and does not\nrequire a positive wallet balance.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://gengen.farm/v1/models`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$GENGEN_API_KEY`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The OpenAI SDK also supports `,_jsx(_components.code,{children:`client.models.list()`}),`. Each entry contains `,_jsx(_components.code,{children:`id`}),`,\n`,_jsx(_components.code,{children:`object: \"model\"`}),`, `,_jsx(_components.code,{children:`created`}),` (`,_jsx(_components.code,{children:`0`}),` when the creation time is unavailable), and\n`,_jsx(_components.code,{children:`owned_by`}),`. The list contains chat models only; it excludes media-only models.\nModel availability does not imply identical tool support on both interfaces.`]}),`\n`,_jsxs(_components.p,{children:[`For CC Switch with Codex, select the `,_jsx(_components.strong,{children:`Responses`}),` upstream format, set the API\nbase URL to `,_jsx(_components.code,{children:`https://gengen.farm/v1`}),`, enter your GENGEN API key, and fetch the model\nlist. Select `,_jsx(_components.code,{children:`gpt-6.1-sol`}),` (or another GPT model), save, and restart Codex. Do not\nselect Chat Completions conversion for reasoning/tool workflows; use Responses\nto preserve native tool calls and reasoning history.`]}),`\n`,_jsxs(_components.p,{children:[`Use HTTP Responses/SSE for this custom provider. Disable Fast/Priority mode;\nGENGEN uses Standard processing, including when `,_jsx(_components.code,{children:`service_tier`}),` is `,_jsx(_components.code,{children:`auto`}),` or\nomitted. Nullable optional settings are treated as omitted. Legacy `,_jsx(_components.code,{children:`user`}),` values\nare scoped to the authenticated caller, like cache and safety identifiers.\nOnly the standard access program is available; elevated access programs and\ninline `,_jsx(_components.code,{children:`moderation`}),` are not supported.`]}),`\n`,_jsx(Heading,{level:`2`,id:`sdk-quickstart`,children:`SDK quickstart`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Chat Completions`,id:`chat-completions`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = OpenAI(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=os.environ[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"GENGEN_API_KEY\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://gengen.farm/v1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`completion = client.chat.completions.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Explain idempotency briefly.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` max_completion_tokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1024`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(completion.choices[`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The response uses native `,_jsx(_components.code,{children:`choices`}),` and `,_jsx(_components.code,{children:`usage`}),`. `,_jsx(_components.code,{children:`messages`}),`, image content parts,\n`,_jsx(_components.code,{children:`response_format`}),`, `,_jsx(_components.code,{children:`max_completion_tokens`}),`, `,_jsx(_components.code,{children:`reasoning_effort`}),`, cache settings\nand metadata retain their native shapes. `,_jsx(_components.code,{children:`store`}),` is always false and `,_jsx(_components.code,{children:`n`}),` must\nbe 1. Use `,_jsx(_components.code,{children:`max_completion_tokens`}),` to bound visible and reasoning output together.`]})]}),_jsxs(Tab,{title:`Responses`,id:`responses`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = OpenAI(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=os.environ[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"GENGEN_API_KEY\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://gengen.farm/v1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Explain idempotency briefly.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` reasoning`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"effort\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"medium\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` max_output_tokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1024`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.output_text)`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The response uses native `,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`object: \"response\"`}),`, `,_jsx(_components.code,{children:`status`}),`, `,_jsx(_components.code,{children:`model`}),`,\n`,_jsx(_components.code,{children:`output`}),` and `,_jsx(_components.code,{children:`usage`}),`. Read every output item: reasoning, messages, tool calls,\ncitations, refusals and approval requests can appear together. The SDK’s\n`,_jsx(_components.code,{children:`output_text`}),` helper collects text items. Examples below use this Python client.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`models-and-reasoning`,children:`Models and reasoning`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model`}),_jsx(_components.th,{children:`Reasoning efforts`}),_jsx(_components.th,{children:`Chat Completions tools`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-6.1-sol`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),`, `,_jsx(_components.code,{children:`max`})]}),_jsx(_components.td,{children:`Use Responses`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-6-astra`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),`, `,_jsx(_components.code,{children:`max`})]}),_jsx(_components.td,{children:`Use Responses`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-6-sol`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),`, `,_jsx(_components.code,{children:`max`})]}),_jsxs(_components.td,{children:[`Functions with `,_jsx(_components.code,{children:`reasoning_effort: \"none\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-6-luna`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),`, `,_jsx(_components.code,{children:`max`})]}),_jsxs(_components.td,{children:[`Functions with `,_jsx(_components.code,{children:`reasoning_effort: \"none\"`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`All four default to `,_jsx(_components.code,{children:`medium`}),`, accept text and images, and support structured text\noutput. Their context window is 1,050,000 tokens, with up to 922,000 input tokens\nand 128,000 output tokens including reasoning. Use `,_jsx(_components.code,{children:`background: true`}),` for long tasks. Hosted foreground requests that exceed\nthe HTTP budget return HTTP 202 with a `,_jsx(_components.code,{children:`Location`}),` header for continued polling.`]}),`\n`,_jsxs(_components.p,{children:[`Sampling and log-probability controls require reasoning effort `,_jsx(_components.code,{children:`none`}),` on Sol/Luna.\nOmit them for Sol 6.1 and Astra. Chat function tools and tool-result history also\nrequire `,_jsx(_components.code,{children:`reasoning_effort: \"none\"`}),` on Sol/Luna; the other models require Responses\nfor tool calling.`]}),`\n`,_jsx(Heading,{level:`2`,id:`images-files-and-structured-output`,children:`Images, files, and structured output`}),`\n`,_jsxs(_components.p,{children:[`In Responses, use native `,_jsx(_components.code,{children:`input_image`}),` parts with HTTPS or data URLs. Files accept `,_jsx(_components.code,{children:`input_file`}),`\nwith an owned `,_jsx(_components.code,{children:`file_id`}),`, `,_jsx(_components.code,{children:`file_url`}),`, or `,_jsx(_components.code,{children:`filename`}),` plus Base64 `,_jsx(_components.code,{children:`file_data`}),`.\n`,_jsx(_components.code,{children:`POST /files`}),` accepts native multipart uploads. The existing JSON Blob upload\nprotocol remains available for media utilities. See `,_jsx(_components.a,{href:`#files-and-resource-management`,children:`Files and resource management`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`text.format`}),` for `,_jsx(_components.code,{children:`json_object`}),` or strict `,_jsx(_components.code,{children:`json_schema`}),` output. `,_jsx(_components.code,{children:`instructions`}),`,\n`,_jsx(_components.code,{children:`reasoning.summary`}),`, `,_jsx(_components.code,{children:`text.verbosity`}),`, `,_jsx(_components.code,{children:`include`}),`, `,_jsx(_components.code,{children:`truncation`}),`, metadata and prompt\ncache options pass through. `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),` and log probabilities require\n`,_jsx(_components.code,{children:`reasoning.effort: \"none\"`}),` on Sol/Luna; omit them for the other models.`]}),`\n`,_jsx(Heading,{level:`2`,id:`responses-and-tools`,children:`Responses and tools`}),`\n`,_jsxs(_components.p,{children:[`Declare tools in `,_jsx(_components.code,{children:`client.responses.create(tools=[...])`}),`. For example:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Research recent developments in battery recycling and cite sources.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"web_search\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` max_output_tokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`4096`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.output_text)`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Tool type`}),_jsx(_components.th,{children:`Execution and requirements`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`function`})}),_jsxs(_components.td,{children:[`Your application executes calls and submits `,_jsx(_components.code,{children:`function_call_output`}),` with the original `,_jsx(_components.code,{children:`call_id`}),`. Supports strict schemas and parallel calls.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom`})}),_jsxs(_components.td,{children:[`Your application executes calls and returns `,_jsx(_components.code,{children:`custom_tool_call_output`}),`; text and grammar formats pass through.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`namespace`})}),_jsx(_components.td,{children:`Groups function and custom declarations.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`web_search`}),`, `,_jsx(_components.code,{children:`web_search_preview`})]}),_jsx(_components.td,{children:`OpenAI performs searches. Search options, allowed domains, citations, and tool events pass through.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mcp`})}),_jsxs(_components.td,{children:[`Supply your own HTTPS `,_jsx(_components.code,{children:`server_url`}),`, optional `,_jsx(_components.code,{children:`authorization`}),`, tool filters, and `,_jsx(_components.code,{children:`require_approval`}),`. Preserve approval requests and submit `,_jsx(_components.code,{children:`mcp_approval_response`}),` explicitly. Shared connectors are unavailable.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`computer`}),`, `,_jsx(_components.code,{children:`computer_use_preview`})]}),_jsx(_components.td,{children:`Your application executes computer actions and returns screenshots and safety acknowledgements.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`shell`})}),_jsxs(_components.td,{children:[`Local execution uses `,_jsx(_components.code,{children:`environment: {\"type\":\"local\"}`}),`. Hosted execution uses `,_jsx(_components.code,{children:`container_auto`}),` or an owned `,_jsx(_components.code,{children:`container_reference`}),`; inline and supported first-party skills can be mounted.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`code_interpreter`})}),_jsx(_components.td,{children:`OpenAI executes Python in an automatic container or a container created by this API key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`file_search`})}),_jsx(_components.td,{children:`Searches vector stores created by this API key. Filters, citations and search-result inclusion pass through.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`image_generation`})}),_jsx(_components.td,{children:`Generates or edits images with the three supported GPT Image models; returns native image items, formats and partial-image events.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`apply_patch`})}),_jsxs(_components.td,{children:[`Your application applies requested changes and returns `,_jsx(_components.code,{children:`apply_patch_call_output`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_search`})}),_jsx(_components.td,{children:`Tool search declarations and results pass through. Client search must return valid function/custom declarations.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Tool declarations, `,_jsx(_components.code,{children:`tool_choice`}),`, `,_jsx(_components.code,{children:`parallel_tool_calls`}),`, `,_jsx(_components.code,{children:`max_tool_calls`}),`, custom\narguments, approval decisions, and tool result items retain their native shapes.\nThe API does not execute client tools or acknowledge safety checks on your behalf.\nSee `,_jsx(_components.a,{href:`/tool-calling`,children:`Function calling`}),` for application execution patterns.`]}),`\n`,_jsx(Heading,{level:`2`,id:`tool-examples`,children:`Tool examples`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Function calling and reasoning replay`,id:`function-calling-and-reasoning-replay`,children:[_jsx(_components.p,{children:`For stateless conversations, preserve all output items, including\nencrypted reasoning, and return a result for every call before continuing:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`26`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`26`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`tools = [{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"function\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"get_weather\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Get the weather for a city.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"parameters\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"properties\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"city\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"required\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"city\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"additionalProperties\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"strict\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`history = [{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"What is the weather in Paris?\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=history, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=tools,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` include`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"reasoning.encrypted_content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response.status != `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Generation ended with `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response.status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` history.extend(response.output)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` calls = [item `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` item `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response.output `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` item.type == `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"function_call\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` calls:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.output_text)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` call `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` calls:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # Validate arguments and execute your application function here.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` history.append({`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"function_call_output\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"call_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: call.call_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"output\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'{\"temperatureC\":22,\"conditions\":\"clear\"}'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`]})})})]}),_jsxs(Accordion,{title:`Files and File Search`,id:`files-and-file-search`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` os, time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = OpenAI(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=os.environ[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"GENGEN_API_KEY\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://gengen.farm/v1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"handbook.pdf\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` document:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` file = client.files.create(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`file`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=document, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`purpose`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"assistants\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"handbook-file-v1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`store = client.vector_stores.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Handbook\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`file_ids`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[file.id],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"handbook-index-v1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` store.status == `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"in_progress\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` store = client.vector_stores.retrieve(store.id)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Summarize the vacation policy and cite the handbook.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"file_search\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"vector_store_ids\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [store.id]}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` include`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"file_search_call.results\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"handbook-question-1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.output_text)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client.vector_stores.delete(store.id)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client.files.delete(file.id)`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Native multipart uploads support `,_jsx(_components.code,{children:`assistants`}),`, `,_jsx(_components.code,{children:`user_data`}),` and `,_jsx(_components.code,{children:`vision`}),`. The\nmultipart body, including the file and fields, must fit within `,_jsx(_components.strong,{children:`4 MB`}),`. Files\nexpire seven days after creation. HTTPS file URLs can supply larger model inputs when the upstream supports the\nformat; inline data must still fit the HTTP request limits. Resumable OpenAI\nUploads and arbitrary global file discovery are not provided. The existing JSON\nBlob media-upload protocol on `,_jsx(_components.code,{children:`/files`}),` remains supported.`]}),_jsxs(_components.p,{children:[`Vector stores reserve `,_jsx(_components.strong,{children:`up to 1 GB of capacity for 24 hours from creation`}),`.\nCreation purchases this fixed capacity period; deleting early does not refund the\nreservation. Activity does not extend it. Retrieval monitors the size, and the\ncleanup service removes stores that exceed capacity or reach expiry. Create a new\nstore for another period. File indexing is asynchronous: poll before searching.`]}),_jsxs(_components.p,{children:[`Supported operations include owned list/create/retrieve/delete; vector-store\nname, description and metadata updates; attach/list/retrieve/update/delete files;\ncreate/retrieve/cancel file batches and list batch files; and `,_jsx(_components.code,{children:`POST /vector_stores/{id}/search`}),`.\nUse at most twenty file IDs per create/attach-batch request. Root resource lists\nare scoped metadata snapshots; retrieve a resource for live upstream status.`]}),_jsx(_components.p,{children:`File content downloads remain subject to upstream restrictions for the file’s\npurpose; an uploaded input document may be unavailable for download even when it\ncan be indexed and searched. Keep the original document in your application.\nUse the container file content endpoint to download Code Interpreter artifacts.`})]}),_jsxs(Accordion,{title:`Code Interpreter and hosted shell`,id:`code-interpreter-and-hosted-shell`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Use Python to calculate the mean of 17, 23 and 41.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"code_interpreter\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"container\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"auto\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"memory_limit\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1g\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.output_text)`})]}),`\n`]})})}),_jsx(_components.p,{children:`For explicit container management:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`container = client.containers.create(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"analysis\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`memory_limit`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1g\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"analysis-container-1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Run a shell command to list the available input files.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"shell\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"environment\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"container_reference\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"container_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: container.id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }}], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client.containers.delete(container.id)`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Code Interpreter also accepts an owned container ID string. Hosted shell supports\n`,_jsx(_components.code,{children:`container_auto`}),` and `,_jsx(_components.code,{children:`container_reference`}),`; local shell remains application-executed.\nContainers support 1, 4, 16 and 64 GB memory, owned input file IDs, native network\npolicies, inline skills and supported first-party skills. Shared custom skill IDs\nare unavailable. First-party skill access depends on upstream availability.`]}),_jsxs(_components.p,{children:[`A new container purchases one session. GENGEN’s fixed deadline is `,_jsx(_components.strong,{children:`19 minutes\nfrom upstream creation`}),`, within the provider’s twenty-minute session window;\nactivity does not renew it. A reference with less than five minutes remaining is\nrejected so you can create a new session. A reused owned container is not charged\nagain within its session. Download artifacts before expiry using\n`,_jsx(_components.code,{children:`GET /containers/{id}/files/{fileId}/content`}),`. Container file upload, list,\nretrieve and delete endpoints are available. Containers are temporary sandboxes,\nnot persistent storage.`]})]}),_jsxs(Accordion,{title:`Image generation during chat`,id:`image-generation-during-chat`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Draw a tiny orchard logo on a white background.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"image_generation\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-image-2.5-flare\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"size\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1024x1024\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"quality\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"low\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`images = [item `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` item `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response.output `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` item.type == `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"image_generation_call\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Each completed image item contains native Base64 result data.`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For 2.6, use native tool fields `,_jsx(_components.code,{children:`complexity`}),`, `,_jsx(_components.code,{children:`output_format`}),`, `,_jsx(_components.code,{children:`frame_count`}),`, and `,_jsx(_components.code,{children:`frame_duration_ms`}),`. GIF output is priced by megapixels across all frames. SVG includes the service price for its rendered reference and the measured author tokens. The native tool returns Base64 output. Use the `,_jsx(_components.a,{href:`/api-reference/openai/image-generation`,children:`Image API`}),` for markup-guided edits or hosted output URLs.`]}),_jsxs(_components.p,{children:[`For SVG, `,_jsx(_components.code,{children:`tools[].svg.model`}),` is optional. With SVG author selection enabled, omit it to use the outer Responses model. For example, `,_jsx(_components.code,{children:`\"svg\": {\"reasoning\": {\"effort\": \"low\"}}`}),` sets only the author’s effort. An explicit author override uses that author’s supported efforts. Without author selection, OpenAI uses its default author and does not accept a model override. See the `,_jsx(_components.a,{href:`https://developers.openai.com/api/reference/resources/responses/methods/create`,children:`OpenAI Responses reference`}),`.`]}),_jsxs(_components.p,{children:[`The image models are `,_jsx(_components.code,{children:`gpt-image-2.6-flare`}),`, `,_jsx(_components.code,{children:`gpt-image-2.6-sunburst`}),`, `,_jsx(_components.code,{children:`gpt-image-2.5-flare`}),`, `,_jsx(_components.code,{children:`gpt-image-2.5-sunburst`}),` and\n`,_jsx(_components.code,{children:`gpt-image-2`}),`. Defaults are GPT Image 2.5 Flare, `,_jsx(_components.code,{children:`1024x1024`}),` (or `,_jsx(_components.code,{children:`auto`}),` for GIF), and `,_jsx(_components.code,{children:`medium`}),`. Native rendering,\nbackground, output format/compression, editing and partial-image options pass\nthrough. Sizes may be `,_jsx(_components.code,{children:`auto`}),` or dimensions divisible by sixteen, within a 1:3 to\n3:1 aspect ratio and the model’s maximum of 3840×2160 pixels. Flare and Sunburst\nalso accept `,_jsx(_components.code,{children:`xhigh`}),` and `,_jsx(_components.code,{children:`max`}),` quality. Provider-specific size constraints still\napply. Previous response IDs and owned image item references enable iterative edits.`]}),_jsxs(_components.p,{children:[`Image tools use a `,_jsx(_components.strong,{children:`fixed GENGEN image service price per output megapixel and\nquality`}),`, plus the parent model’s measured tokens. This differs from the dedicated\nimage endpoint’s token pricing. The upstream image tool does not expose complete\nindependent image token usage; GENGEN does not invent it or claim an exact upstream\nimage cost. Check current final service prices before generating.`]}),_jsxs(_components.p,{children:[`For a standalone image request without a GPT conversation, use the\n`,_jsx(_components.a,{href:`/api-reference/openai/image-generation`,children:`Image API`}),`.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`files-and-resource-management`,children:`Files and resource management`}),`\n`,_jsxs(_components.p,{children:[`Files, containers and vector stores support chat tools through separate resource\nendpoints. Resources belong to the creating account, workspace and `,_jsx(_components.strong,{children:`API key`}),`;\nuse that same key for subsequent requests. IDs from OpenAI directly or another\nGENGEN key are unavailable. Root lists return scoped metadata snapshots; retrieve\na resource for its live status.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Resource`}),_jsx(_components.th,{children:`Endpoints and supported operations`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Files`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`/v1/files`}),`: upload/list; `,_jsx(_components.code,{children:`/v1/files/{id}`}),`: retrieve/delete; `,_jsx(_components.code,{children:`/v1/files/{id}/content`}),`: download where the upstream purpose permits.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Containers`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`/v1/containers`}),`: create/list; `,_jsx(_components.code,{children:`/v1/containers/{id}`}),`: retrieve/delete; `,_jsx(_components.code,{children:`/v1/containers/{id}/files`}),` and nested file/content routes: upload, attach, list, retrieve, download and delete artifacts.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Vector stores`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`/v1/vector_stores`}),`: create/list; `,_jsx(_components.code,{children:`/v1/vector_stores/{id}`}),`: retrieve/update/delete; nested `,_jsx(_components.code,{children:`files`}),`, `,_jsx(_components.code,{children:`file_batches`}),` and `,_jsx(_components.code,{children:`search`}),` routes: index files, manage attributes, poll/cancel indexing batches and search.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Stored responses`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`/v1/responses/{id}`}),`: retrieve/delete; `,_jsx(_components.code,{children:`/cancel`}),`: cancel; `,_jsx(_components.code,{children:`/input_items`}),`: retrieve input history; streaming retrieval supports `,_jsx(_components.code,{children:`starting_after`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Service prices`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET /v1/openai/pricing`}),`: current final USD tool, image, session and capacity prices.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/openapi/openai-llm.yaml`,children:`OpenAPI specification`}),` for every operation’s\nparameters and response schema. Resource SDK examples are in `,_jsx(_components.a,{href:`#tool-examples`,children:`Tool examples`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`stored-and-background-responses`,children:`Stored and background responses`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`store: true`}),` to retain a response. Once it has finalized, pass its ID in\n`,_jsx(_components.code,{children:`previous_response_id`}),` to continue the conversation with the same key and workspace:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`first = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Remember that the project name is Orchard.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` first.status != `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Finalize the first response before continuing.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`followup = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-luna\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"What is the project name?\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` previous_response_id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=first.id, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(followup.output_text)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Plain requests default to stateless execution. Hosted tools and owned resource\nreferences use durable execution and default to `,_jsx(_components.code,{children:`store: true`}),`. Explicit\n`,_jsx(_components.code,{children:`store: false`}),` retains recovery state for at most ten minutes. Only a finalized\nstored response can be used as `,_jsx(_components.code,{children:`previous_response_id`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6-astra\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Analyze the attached research thoroughly.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` background`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`max_output_tokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`8192`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"research-run-1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response.status `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"queued\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"in_progress\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response = client.responses.retrieve(response.id)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.status)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# To cancel active work: client.responses.cancel(response.id)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# To remove a finalized response: client.responses.delete(response.id)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Responses keep native IDs and snake_case fields. Stored responses expire after\nthirty days; explicit `,_jsx(_components.code,{children:`store: false`}),` permits a ten-minute recovery window. Stored\nprevious responses must be finalized before reuse. `,_jsx(_components.code,{children:`GET /responses/{id}/input_items`}),`\nis supported. Long foreground hosted calls may return HTTP 202 with a `,_jsx(_components.code,{children:`Location`}),`\nheader; continue polling that response ID.`]}),`\n`,_jsxs(_components.p,{children:[`Set both `,_jsx(_components.code,{children:`background: true`}),` and `,_jsx(_components.code,{children:`stream: true`}),` to receive native SSE and later\nresume with `,_jsx(_components.code,{children:`GET /responses/{id}?stream=true\u0026starting_after={sequenceNumber}`}),`.\nSequence numbers and tool events retain their native shape. Only a response\noriginally created with streaming can be resumed this way. A disconnect leaves\nhosted work running; cancel explicitly. Usage proven before cancellation remains\nbillable. Wallet settlement precedes terminal events and terminal retrieval.`]}),`\n`,_jsx(Heading,{level:`2`,id:`long-conversations-and-compaction`,children:`Long conversations and compaction`}),`\n`,_jsxs(_components.p,{children:[`To enable server-side compaction during generation, add\n`,_jsx(_components.code,{children:`context_management: [{\"type\": \"compaction\", \"compact_threshold\": 200000}]`}),` to a\nResponses request. At most one entry is supported; an explicit threshold must\nbe an integer of at least 1000 tokens. Preserve encrypted compaction items in\nconversation history just like other native output items.`]}),`\n`,_jsxs(_components.p,{children:[`For explicit compaction, use `,_jsx(_components.code,{children:`POST /v1/responses/compact`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`compacted = client.responses.compact(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=conversation_items,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.responses.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` input`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[*compacted.output, {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Continue.\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The compact endpoint returns a native `,_jsx(_components.code,{children:`response.compaction`}),` object with `,_jsx(_components.code,{children:`id`}),`,\n`,_jsx(_components.code,{children:`created_at`}),`, `,_jsx(_components.code,{children:`output`}),`, and `,_jsx(_components.code,{children:`usage`}),`. Pass the complete `,_jsx(_components.code,{children:`output`}),` into the next\nrequest. It supports `,_jsx(_components.code,{children:`instructions`}),`, caller-scoped prompt-cache settings, and an\nowned, stored, settled `,_jsx(_components.code,{children:`previous_response_id`}),`. It does not stream or execute tools.\nCompaction uses the model’s token prices and requires wallet balance; settlement\nfinishes before the compacted window is returned. Retained historical tool calls\nare not charged again. If submission is ambiguous, do not automatically repeat it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`streaming-and-billing`,children:`Streaming and billing`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`stream: true`}),` to receive native typed SSE events, including text, reasoning\nsummaries, tool argument deltas, citations, approvals and tool status events.\nResponses ends with `,_jsx(_components.code,{children:`response.completed`}),`, `,_jsx(_components.code,{children:`response.incomplete`}),`, `,_jsx(_components.code,{children:`response.failed`}),`, or `,_jsx(_components.code,{children:`response.cancelled`}),`; it does not use Chat Completions’ `,_jsx(_components.code,{children:`[DONE]`}),` marker.`]}),`\n`,_jsxs(_components.p,{children:[`Responses accepts `,_jsx(_components.code,{children:`stream_options: {\"include_obfuscation\": false}`}),` with\n`,_jsx(_components.code,{children:`stream: true`}),`, including requests from Codex through CC Switch. This native\noption controls the upstream stream’s padding fields and is passed through\nunchanged. Omit it to keep the upstream default; `,_jsx(_components.code,{children:`null`}),` and an empty object are\nalso accepted. Codex’s `,_jsx(_components.code,{children:`reasoning_summary_delivery: \"sequential_cutoff\"`}),` and\nboolean `,_jsx(_components.code,{children:`include_usage`}),` are accepted as compatibility hints and consumed locally.\nThey are not forwarded to the public upstream API: summary delivery follows\nnative SSE behavior and Responses usage still comes from terminal events.`]}),`\n`,_jsxs(_components.p,{children:[`Wallet settlement finishes before the terminal event is delivered. A local\ntransport or settlement failure emits `,_jsx(_components.code,{children:`event: error`}),` and closes without a successful\nterminal event. Treat deltas as provisional. Disconnects do not automatically\nresubmit work. Requests with ambiguous provider acceptance retain their reservation\nfor reconciliation.`]}),`\n`,_jsxs(_components.p,{children:[`Measured input, cached input, cache writes, and output are billed separately.\nReasoning tokens are already included in output tokens. Web search has an\nadditional per-call charge; retrieved content tokens are included in model usage.\nPrompts above 272,000 input tokens use the long-context price for the full request.\nCheck `,_jsx(_components.a,{href:`/pricing`,children:`Pricing`}),` for current final customer prices.`]}),`\n`,_jsxs(_components.p,{children:[`Chat Completions uses native text/function-argument deltas and ends with `,_jsx(_components.code,{children:`[DONE]`}),`.\nUsage is requested upstream even if `,_jsx(_components.code,{children:`stream_options.include_usage`}),` was false.\nFinish/usage chunks and `,_jsx(_components.code,{children:`[DONE]`}),` follow wallet settlement; a billing failure emits\nan error without `,_jsx(_components.code,{children:`[DONE]`}),`. The same measured token rates and reconciliation rules\napply to both interfaces.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /v1/openai/pricing`}),` returns current `,_jsx(_components.strong,{children:`final USD service prices`}),` for tools,\nimages, container sessions and vector capacity. Model token rates are listed on\n`,_jsx(_components.a,{href:`/pricing`,children:`Pricing`}),`. File upload/download/list and resource retrieval/deletion have\nno additional generation fee. File-search calls and direct vector searches have a\nper-call fee, separate from vector capacity and model input/output tokens.`]}),`\n`,_jsxs(_components.p,{children:[`Generation reserves wallet balance before upstream submission, then captures the\nmeasured token/tool charge and releases unused funds. Tool limits default to five\nand accept one to twenty; hosted output defaults to 4096 tokens. Dedicated resource\nfees use the `,_jsx(_components.code,{children:`openai-hosted-resources`}),` billing service and cannot consume credits\nrestricted to a GPT generation model. There is a per-account quota of one hundred\nactive root resources and twenty unsettled operations.`]}),`\n`,_jsxs(_components.p,{children:[`Send a stable `,_jsx(_components.code,{children:`Idempotency-Key`}),` for every create or paid operation. Retrying the\nsame key and payload returns the existing result; another payload returns HTTP\n409. A lost upstream submission receipt is retained for reconciliation and `,_jsx(_components.strong,{children:`never\nrepeated automatically`}),`. Retry with the same key and contact support if it remains\nunresolved; changing the key may create another paid operation.`]}),`\n`,_jsx(Heading,{level:`2`,id:`availability-boundaries`,children:`Availability boundaries`}),`\n`,_jsxs(_components.p,{children:[`Only Standard processing (`,_jsx(_components.code,{children:`service_tier: \"default\"`}),`) is exposed. Conversation IDs,\nstored prompt IDs, shared upstream connectors, arbitrary upstream resource IDs,\nRealtime, Assistants, Batch and WebSocket sessions remain outside this interface.\nAudio/video input is not supported by these GPT models. Client-side functions,\ncomputer actions, patches and local shell commands remain application-executed.`]}),`\n`,_jsx(_components.p,{children:`Unsupported options and unowned references are rejected before wallet admission.\nTool access still depends on the configured upstream project’s model permissions.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Chat","sidebarTitle":"Chat","description":"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.","openapi":"openapi/openai-llm.yaml POST /chat/completions","href":"/api-reference/openai/chat-completions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Model discovery and Codex setup","slug":"model-discovery-and-codex-setup","depth":2,"children":[]},{"title":"SDK quickstart","slug":"sdk-quickstart","depth":2,"children":[]},{"title":"Models and reasoning","slug":"models-and-reasoning","depth":2,"children":[]},{"title":"Images, files, and structured output","slug":"images-files-and-structured-output","depth":2,"children":[]},{"title":"Responses and tools","slug":"responses-and-tools","depth":2,"children":[]},{"title":"Tool examples","slug":"tool-examples","depth":2,"children":[]},{"title":"Files and resource management","slug":"files-and-resource-management","depth":2,"children":[]},{"title":"Stored and background responses","slug":"stored-and-background-responses","depth":2,"children":[]},{"title":"Long conversations and compaction","slug":"long-conversations-and-compaction","depth":2,"children":[]},{"title":"Streaming and billing","slug":"streaming-and-billing","depth":2,"children":[]},{"title":"Availability boundaries","slug":"availability-boundaries","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createOpenAIGPTChatCompletion","summary":"Generate GPT Chat Completions","description":"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.","requestBody":"03f37bde-6965-42e5-8642-245bb62aae27","responses":{"200":"309bf46c-d97a-4942-b7a1-12a4c75ed9b7","400":"868ed686-946d-4803-8344-5f1b5470f3a8","401":"4d6972fd-8a97-4b17-90fd-835d4bdf51c1","402":"0bc78dc7-63c6-4d27-9380-78e37eb336ed","429":"23c2d9f2-89a4-42d7-8e9f-eef998b2cb80","502":"d6276e46-bb08-42e5-9a75-9bc1943f49f9"},"method":"post","type":"path","servers":["03e70f65-369f-43da-89fd-257c3a456e6b"],"security":["3bb258ba-d2b4-483b-af7b-0860c56b0d2d"],"path":"/chat/completions","baseUrlOptions":["https://gengen.farm/api/gengen/v1"],"title":"Generate GPT Chat Completions","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["gpt-6.1-sol","gpt-6-astra","gpt-6-sol","gpt-6-luna"],"isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":true,"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"max_completion_tokens":{"oneOf":[{"type":"integer","minimum":1,"maximum":128000,"uniqueKey":"max_completion_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128000,"uniqueKey":"max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_completion_tokens","typeLabel":"integer | null"},"max_tokens":{"oneOf":[{"type":"integer","minimum":1,"maximum":128000,"deprecated":true,"uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128000,"deprecated":true,"uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer | null"},"reasoning_effort":{"oneOf":[{"type":"string","enum":["none","low","medium","high","xhigh","max",null],"default":"medium","uniqueKey":"reasoning_effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["none","low","medium","high","xhigh","max",null],"default":"medium","uniqueKey":"reasoning_effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring> | null"},"tools":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"description":"Function declarations only on Sol/Luna with reasoning_effort none.","uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","uniqueKey":"tool_choice.oneOf.0","typeLabel":"string"},{"type":"object","additionalProperties":true,"uniqueKey":"tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"string | object"},"functions":{"type":"array","deprecated":true,"items":{"type":"object","additionalProperties":true,"uniqueKey":"functions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"functions","typeLabel":"object[]"},"function_call":{"oneOf":[{"type":"string","deprecated":true,"uniqueKey":"function_call.oneOf.0","typeLabel":"string"},{"type":"object","deprecated":true,"additionalProperties":true,"uniqueKey":"function_call.oneOf.1","typeLabel":"object"}],"uniqueKey":"function_call","typeLabel":"string | object"},"parallel_tool_calls":{"oneOf":[{"type":"boolean","uniqueKey":"parallel_tool_calls.oneOf.0","typeLabel":"boolean"},{"type":"null","uniqueKey":"parallel_tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"parallel_tool_calls","typeLabel":"boolean | null"},"response_format":{"oneOf":[{"type":"object","additionalProperties":true,"uniqueKey":"response_format.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":true,"uniqueKey":"response_format.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format","typeLabel":"object | null"},"stream":{"oneOf":[{"type":"boolean","default":false,"uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"type":"object","additionalProperties":true,"uniqueKey":"stream_options.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":true,"uniqueKey":"stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options","typeLabel":"object | null"},"temperature":{"oneOf":[{"type":"number","description":"Requires reasoning_effort none.","uniqueKey":"temperature.oneOf.0","typeLabel":"number"},{"type":"null","description":"Requires reasoning_effort none.","uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","description":"Requires reasoning_effort none.","uniqueKey":"top_p.oneOf.0","typeLabel":"number"},{"type":"null","description":"Requires reasoning_effort none.","uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number | null"},"logprobs":{"oneOf":[{"type":"boolean","description":"Requires reasoning_effort none.","uniqueKey":"logprobs.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Requires reasoning_effort none.","uniqueKey":"logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"logprobs","typeLabel":"boolean | null"},"top_logprobs":{"oneOf":[{"type":"integer","description":"Requires reasoning_effort none.","uniqueKey":"top_logprobs.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Requires reasoning_effort none.","uniqueKey":"top_logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_logprobs","typeLabel":"integer | null"},"presence_penalty":{"oneOf":[{"type":"number","uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number | null"},"frequency_penalty":{"oneOf":[{"type":"number","uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number | null"},"stop":{"oneOf":[{"type":"null","uniqueKey":"stop.oneOf.0","typeLabel":"null"},{"type":"string","uniqueKey":"stop.oneOf.1","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.2.items.[INDEX]","typeLabel":"string"},"uniqueKey":"stop.oneOf.2","typeLabel":"string[]"}],"uniqueKey":"stop","typeLabel":"null | string | string[]"},"seed":{"oneOf":[{"type":"integer","uniqueKey":"seed.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","enum":[1,null],"uniqueKey":"n.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","enum":[1,null],"uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"enum\u003cinteger> | null"},"metadata":{"oneOf":[{"type":"object","additionalProperties":{"type":"string","uniqueKey":"metadata.oneOf.0.additionalProperties","typeLabel":"string"},"uniqueKey":"metadata.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":{"type":"string","uniqueKey":"metadata.oneOf.1.additionalProperties","typeLabel":"string"},"uniqueKey":"metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"metadata","typeLabel":"object | null"},"user":{"oneOf":[{"type":"string","description":"Legacy identifier, hashed in caller scope.","uniqueKey":"user.oneOf.0","typeLabel":"string"},{"type":"null","description":"Legacy identifier, hashed in caller scope.","uniqueKey":"user.oneOf.1","typeLabel":"null"}],"uniqueKey":"user","typeLabel":"string | null"},"safety_identifier":{"oneOf":[{"type":"string","uniqueKey":"safety_identifier.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"safety_identifier.oneOf.1","typeLabel":"null"}],"uniqueKey":"safety_identifier","typeLabel":"string | null"},"prompt_cache_key":{"oneOf":[{"type":"string","uniqueKey":"prompt_cache_key.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"prompt_cache_key.oneOf.1","typeLabel":"null"}],"uniqueKey":"prompt_cache_key","typeLabel":"string | null"},"prompt_cache_options":{"type":"object","additionalProperties":true,"uniqueKey":"prompt_cache_options","typeLabel":"object"},"prompt_cache_retention":{"oneOf":[{"type":"string","uniqueKey":"prompt_cache_retention.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"prompt_cache_retention.oneOf.1","typeLabel":"null"}],"uniqueKey":"prompt_cache_retention","typeLabel":"string | null"},"service_tier":{"oneOf":[{"type":"string","enum":["auto","default",null],"description":"Auto and omission use Standard processing.","uniqueKey":"service_tier.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["auto","default",null],"description":"Auto and omission use Standard processing.","uniqueKey":"service_tier.oneOf.1","typeLabel":"null"}],"uniqueKey":"service_tier","typeLabel":"enum\u003cstring> | null"},"store":{"oneOf":[{"type":"boolean","enum":[false,null],"uniqueKey":"store.oneOf.0","typeLabel":"enum\u003cboolean>"},{"type":"null","enum":[false,null],"uniqueKey":"store.oneOf.1","typeLabel":"null"}],"uniqueKey":"store","typeLabel":"enum\u003cboolean> | null"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"model":"gpt-6-luna","messages":[{"role":"user","content":"Explain idempotency briefly."}],"max_completion_tokens":1024},"examples":{"Example":{"title":"Example","value":{"model":"gpt-6-luna","messages":[{"role":"user","content":"Explain idempotency briefly."}],"max_completion_tokens":1024}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"309bf46c-d97a-4942-b7a1-12a4c75ed9b7":{"description":"Native Chat Completion or SSE chunks. Finish/usage chunks and DONE follow wallet settlement.","content":{"application/json":{"schema":{"type":"object","required":["id","choices","usage"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"usage","typeLabel":"object"},"object":{"const":"chat.completion","uniqueKey":"object","typeLabel":"any"},"model":{"type":"string","uniqueKey":"model","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","choices":[{}],"usage":{},"object":"chat.completion","model":"\u003cstring>"}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"examples":{"Example":{"title":"Example","value":"\u003cstring>"}},"exampleType":"generated"}},"exampleType":"generated"},"868ed686-946d-4803-8344-5f1b5470f3a8":{"description":"Unsupported model, tool, reasoning, sampling, tier, or resource reference.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"4d6972fd-8a97-4b17-90fd-835d4bdf51c1":{"description":"Invalid GENGEN API key.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"0bc78dc7-63c6-4d27-9380-78e37eb336ed":{"description":"Insufficient model-eligible wallet balance.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"23c2d9f2-89a4-42d7-8e9f-eef998b2cb80":{"description":"Upstream rate limit.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"d6276e46-bb08-42e5-9a75-9bc1943f49f9":{"description":"Provider or usage reconciliation failure.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"3bb258ba-d2b4-483b-af7b-0860c56b0d2d":{"bearerAuth":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"03e70f65-369f-43da-89fd-257c3a456e6b":{"url":"https://gengen.farm/api/gengen/v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi/openai-llm.yaml"},"subdomain":"apifarm","siteName":"GENGEN API","title":"Chat - GENGEN API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-19T04:48:26.034Z","originalFileLocation":"api-reference/openai/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\">\u003cmeta data-mint-head name=\"application-name\" content=\"GENGEN API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat - GENGEN API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"GENGEN API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gengen.farm/api-reference/openai/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apifarm.mintlify.site/_mintlify/api/og/v2?division=Text+API\u0026amp;title=Chat\u0026amp;description=Chat+with+GPT+models+using+Chat+Completions+or+Responses%2C+including+tools%2C+files%2C+image+generation%2C+streaming%2C+and+background+work.\u0026amp;theme=2ec39a2db59b215c26a0196f\u0026amp;signature=88bc745f9fdacc4d53a5974117cf868443635c76f093997acba00a7494173a52\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat - GENGEN API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apifarm.mintlify.site/_mintlify/api/og/v2?division=Text+API\u0026amp;title=Chat\u0026amp;description=Chat+with+GPT+models+using+Chat+Completions+or+Responses%2C+including+tools%2C+files%2C+image+generation%2C+streaming%2C+and+background+work.\u0026amp;theme=2ec39a2db59b215c26a0196f\u0026amp;signature=88bc745f9fdacc4d53a5974117cf868443635c76f093997acba00a7494173a52\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/apifarm/L9vLMowDZG_ohQU0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"GENGEN API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#007F7C\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gengen.farm/api-reference/openai/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/openai/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gengen.farm/#organization\",\"name\":\"GENGEN API\",\"url\":\"https://docs.gengen.farm\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/apifarm/8i6PZnnhDG4uij12/logo-light.svg?fit=max\u0026auto=format\u0026n=8i6PZnnhDG4uij12\u0026q=85\u0026s=44296f0917d75c0ed5aa05513ec6c402\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gengen.farm#website\",\"name\":\"GENGEN API\",\"url\":\"https://docs.gengen.farm\",\"publisher\":{\"@id\":\"https://docs.gengen.farm/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gengen.farm/api-reference/openai/chat-completions#webpage\",\"url\":\"https://docs.gengen.farm/api-reference/openai/chat-completions\",\"name\":\"Chat\",\"description\":\"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\",\"dateModified\":\"2026-11-19T04:48:26.034Z\",\"isPartOf\":{\"@id\":\"https://docs.gengen.farm#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gengen.farm/api-reference/openai/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gengen.farm/api-reference/openai/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"GENGEN API\",\"item\":\"https://docs.gengen.farm\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat\",\"item\":\"https://docs.gengen.farm/api-reference/openai/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gengen.farm/api-reference/openai/chat-completions#apireference\",\"headline\":\"Chat\",\"name\":\"Chat\",\"description\":\"Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.\",\"url\":\"https://docs.gengen.farm/api-reference/openai/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gengen.farm/api-reference/openai/chat-completions#webpage\"},\"dateModified\":\"2026-11-19T04:48:26.034Z\",\"publisher\":{\"@id\":\"https://docs.gengen.farm/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gengen.farm#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"GENGEN API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"GENGEN API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/openai/chat-completions.md","siteName":"GENGEN API","nav":{"global":null,"tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Models","pages":[{"title":"Models","href":"/models/overview"}]},{"tab":"API Reference","groups":[{"group":"Reference","pages":[{"title":"API reference","href":"/api-reference/introduction"},{"title":"Video capabilities","href":"/api-reference/video-capabilities"},{"title":"Function calling","href":"/tool-calling"}]},{"group":"BytePlus","pages":[{"group":"Text API","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/openapi/gengen-v1.yaml post /chat/completions","href":"/api-reference/byteplus/text-generation/chat-completions"}]},{"group":"Video API","pages":[{"title":"Create a video generation task","deprecated":null,"version":null,"sidebarTitle":"Create task","openapi":"/openapi/gengen-v1.yaml post /contents/generations/tasks","href":"/api-reference/byteplus/video-generation/create-task"},{"title":"Retrieve a video generation task","deprecated":null,"version":null,"sidebarTitle":"Retrieve task","openapi":"/openapi/gengen-v1.yaml get /contents/generations/tasks/{id}","href":"/api-reference/byteplus/video-generation/retrieve-task"},{"title":"List video generation tasks","deprecated":null,"version":null,"sidebarTitle":"List tasks","openapi":"/openapi/gengen-v1.yaml get /contents/generations/tasks","href":"/api-reference/byteplus/video-generation/list-tasks"},{"title":"Cancel or delete a video generation task","deprecated":null,"version":null,"sidebarTitle":"Cancel or delete task","openapi":"/openapi/gengen-v1.yaml delete /contents/generations/tasks/{id}","href":"/api-reference/byteplus/video-generation/cancel-task"},{"title":"Create a video understanding response","deprecated":null,"version":null,"sidebarTitle":"Create response","openapi":"/openapi/gengen-v1.yaml post /responses","href":"/api-reference/byteplus/video-understanding/create-response"}]},{"group":"Video Enhancement API","pages":[{"title":"Video enhancement","href":"/api-reference/byteplus/video-enhancement/overview"},{"title":"Create a video enhancement task","deprecated":null,"version":null,"sidebarTitle":"Create task","openapi":"/openapi/gengen-v1.yaml post /video/enhancements","href":"/api-reference/byteplus/video-enhancement/create-task"},{"title":"Retrieve a video enhancement task","deprecated":null,"version":null,"sidebarTitle":"Retrieve task","openapi":"/openapi/gengen-v1.yaml get /video/enhancements/{id}","href":"/api-reference/byteplus/video-enhancement/retrieve-task"}]},{"group":"Image API","pages":[{"title":"Generate images","deprecated":null,"version":null,"sidebarTitle":"Generate images","openapi":"/openapi/gengen-v1.yaml post /images/generations","href":"/api-reference/byteplus/image-generation/create-image"}]},{"group":"Assets API","pages":[{"title":"Create an asset group","sidebarTitle":"Create asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups","href":"/api-reference/byteplus/assets/create-asset-group"},{"title":"List asset groups","sidebarTitle":"List asset groups","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/list","href":"/api-reference/byteplus/assets/list-asset-groups"},{"title":"Get an asset group","sidebarTitle":"Get asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/get","href":"/api-reference/byteplus/assets/get-asset-group"},{"title":"Update an asset group","sidebarTitle":"Update asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/update","href":"/api-reference/byteplus/assets/update-asset-group"},{"title":"Create an asset","sidebarTitle":"Create asset","openapi":"openapi/byteplus-assets.yaml POST /assets","href":"/api-reference/byteplus/assets/create-asset"},{"title":"Get an asset","sidebarTitle":"Get asset","openapi":"openapi/byteplus-assets.yaml POST /assets/get","href":"/api-reference/byteplus/assets/get-asset"},{"title":"Update an asset","sidebarTitle":"Update asset","openapi":"openapi/byteplus-assets.yaml POST /assets/update","href":"/api-reference/byteplus/assets/update-asset"},{"title":"List assets","sidebarTitle":"List assets","openapi":"openapi/byteplus-assets.yaml POST /assets/list","href":"/api-reference/byteplus/assets/list-assets"},{"title":"List public assets","sidebarTitle":"List public assets","openapi":"openapi/byteplus-assets.yaml GET /assets/public","href":"/api-reference/byteplus/assets/public-assets"},{"title":"Delete an asset","sidebarTitle":"Delete asset","openapi":"openapi/byteplus-assets.yaml POST /assets/delete","href":"/api-reference/byteplus/assets/delete-asset"},{"title":"Delete an asset group","sidebarTitle":"Delete asset group","openapi":"openapi/byteplus-assets.yaml POST /assets/groups/delete","href":"/api-reference/byteplus/assets/delete-asset-group"},{"title":"Create a real-person verification session","sidebarTitle":"Create verification session","openapi":"openapi/byteplus-assets.yaml POST /assets/real-human/verification-sessions","href":"/api-reference/byteplus/assets/create-real-human-session"},{"title":"Get a real-person verification result","sidebarTitle":"Get verification result","description":"Retrieve the real-person group ID after a successful H5 callback, before the single-use token expires.","openapi":"openapi/byteplus-assets.yaml POST /assets/real-human/verification-results","href":"/api-reference/byteplus/assets/get-real-human-result"}]}]},{"group":"OpenAI","pages":[{"group":"Text API","pages":[{"title":"Chat","sidebarTitle":"Chat","openapi":"openapi/openai-llm.yaml POST /chat/completions","href":"/api-reference/openai/chat-completions"}]},{"group":"Image API","pages":[{"title":"OpenAI image generation","sidebarTitle":"Image generation","description":"Generate or edit images with GPT Image models using GENGEN API keys.","openapi":"openapi/openai.yaml POST /images/generations","href":"/api-reference/openai/image-generation"}]}]},{"group":"Kling","pages":[{"group":"Video API","pages":[{"title":"Create a Kling video task","sidebarTitle":"Create task","openapi":"openapi/kling-video.yaml POST /contents/generations/tasks","href":"/api-reference/kling/video-generation/create-task"},{"title":"Retrieve a Kling video task","sidebarTitle":"Retrieve task","openapi":"openapi/kling-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/kling/video-generation/retrieve-task"},{"title":"Kling errors and task status","sidebarTitle":"Errors and task status","href":"/api-reference/kling/video-generation/errors-and-callbacks"}]},{"group":"Kling 4.0","pages":[{"title":"Kling 4.0 API","sidebarTitle":"Overview","href":"/api-reference/kling/4.0/overview"},{"title":"Create a Kling 4.0 task","sidebarTitle":"Create task","openapi":"openapi/kling-40-video.yaml POST /contents/generations/tasks","href":"/api-reference/kling/4.0/create-task"},{"title":"Retrieve a Kling 4.0 task","sidebarTitle":"Retrieve task","openapi":"openapi/kling-40-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/kling/4.0/retrieve-task"},{"title":"List Kling voices","sidebarTitle":"List voices","openapi":"openapi/kling-40-video.yaml GET /video/kling/voices","href":"/api-reference/kling/4.0/voices"},{"title":"Create a private Kling voice","sidebarTitle":"Create a voice","openapi":"openapi/kling-40-video.yaml POST /video/kling/voices","href":"/api-reference/kling/4.0/create-voice"},{"title":"Get a Kling voice operation","sidebarTitle":"Get voice operation","openapi":"openapi/kling-40-video.yaml GET /video/kling/voice-operations/{operationId}","href":"/api-reference/kling/4.0/get-voice-operation"},{"title":"Delete a private Kling voice","sidebarTitle":"Delete a voice","openapi":"openapi/kling-40-video.yaml DELETE /video/kling/voices/{voiceId}","href":"/api-reference/kling/4.0/delete-voice"}]}]},{"group":"MiniMax","pages":[{"group":"Video API","pages":[{"title":"Create a MiniMax video task","sidebarTitle":"Create task","openapi":"openapi/minimax-video.yaml POST /contents/generations/tasks","href":"/api-reference/minimax/video-generation/create-task"},{"title":"Retrieve a MiniMax video task","sidebarTitle":"Retrieve task","openapi":"openapi/minimax-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/minimax/video-generation/retrieve-task"},{"title":"List MiniMax video tasks","sidebarTitle":"List tasks","openapi":"openapi/minimax-video.yaml GET /contents/generations/tasks","href":"/api-reference/minimax/video-generation/list-tasks"},{"title":"Cancel or delete a MiniMax task","sidebarTitle":"Cancel task","openapi":"openapi/minimax-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/minimax/video-generation/cancel-task"},{"title":"MiniMax errors and task status","sidebarTitle":"Errors and task status","href":"/api-reference/minimax/video-generation/errors-and-callbacks"}]}]},{"group":"Happy Horse","pages":[{"title":"Create a Happy Horse video task","sidebarTitle":"Create task","openapi":"openapi/happy-horse-video.yaml POST /contents/generations/tasks","href":"/api-reference/happy-horse/video-generation/create-task"},{"title":"Retrieve Happy Horse video task","sidebarTitle":"Retrieve task","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/happy-horse/video-generation/retrieve-task"}]},{"group":"Google","pages":[{"group":"Text API","pages":[{"title":"Chat completions with Gemini","sidebarTitle":"Chat completions","openapi":"openapi/google.yaml POST /chat/completions","href":"/api-reference/google/chat-completions"}]},{"group":"Multimodal API","pages":[{"title":"Multimodal responses with Gemini","sidebarTitle":"Responses","openapi":"openapi/google.yaml POST /responses","href":"/api-reference/google/responses"}]},{"group":"Tools","pages":[{"title":"Gemini tools","href":"/api-reference/google/tools"},{"title":"Count input tokens","openapi":"openapi/google.yaml POST /token-counts","href":"/api-reference/google/token-counts"}]},{"group":"Image API","pages":[{"title":"Generate images with Gemini","sidebarTitle":"Image generation","openapi":"openapi/google.yaml POST /images/generations","href":"/api-reference/google/image-generation"}]},{"group":"Video API","pages":[{"title":"Generate and edit videos with Omni","sidebarTitle":"Omni: Create task","openapi":"openapi/omni-video.yaml POST /contents/generations/tasks","href":"/api-reference/google/omni-video-generation"},{"title":"Retrieve an Omni video task","sidebarTitle":"Omni: Retrieve task","openapi":"openapi/omni-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/google/omni-retrieve-task"},{"title":"Generate videos with Veo","sidebarTitle":"Create task","openapi":"openapi/veo-video.yaml POST /contents/generations/tasks","href":"/api-reference/google/veo-video-generation"},{"title":"Retrieve a Veo video task","sidebarTitle":"Retrieve task","openapi":"openapi/veo-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/google/veo-retrieve-task"}]}]},{"group":"Flash VSR","pages":[{"group":"Video Upscale","pages":[{"title":"Create a Flash VSR task","sidebarTitle":"Create task","openapi":"openapi/flash-vsr-video.yaml POST /contents/generations/tasks","href":"/api-reference/flash-vsr/video-upscale/create-task"},{"title":"Retrieve Flash VSR task","sidebarTitle":"Retrieve task","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/flash-vsr/video-upscale/retrieve-task"},{"title":"Delete Flash VSR task","sidebarTitle":"Delete task","api":"DELETE https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/flash-vsr/video-upscale/delete-task"}]}]},{"group":"Wan","pages":[{"group":"Spicy","pages":[{"group":"Video API","pages":[{"title":"Create a Wan video task","sidebarTitle":"Create task","openapi":"openapi/wan-video.yaml POST /contents/generations/tasks","href":"/api-reference/wan/video-generation/create-task"},{"title":"Retrieve Wan video task","sidebarTitle":"Retrieve task","api":"GET https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/wan/video-generation/retrieve-task"},{"title":"Delete Wan video task","sidebarTitle":"Delete task","api":"DELETE https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}","playground":"none","href":"/api-reference/wan/video-generation/delete-task"}]},{"group":"Image API","pages":[{"title":"Create a z-image task","sidebarTitle":"Create z-image task","openapi":"openapi/wan-z-image.yaml POST /z-images/generations","href":"/api-reference/wan/image-generation/z-image"},{"title":"Retrieve a z-image task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-z-image.yaml GET /z-images/generations/{id}","href":"/api-reference/wan/image-generation/z-image/tasks"},{"title":"Delete a z-image task","sidebarTitle":"Delete task","openapi":"openapi/wan-z-image.yaml DELETE /z-images/generations/{id}","href":"/api-reference/wan/image-generation/z-image/tasks-delete"},{"title":"Create a Wan face swap task","sidebarTitle":"Create face swap task","openapi":"openapi/wan-face-swap.yaml POST /wan-face-swaps/generations","href":"/api-reference/wan/image-generation/face-swap"},{"title":"Retrieve a Wan face swap task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-face-swap.yaml GET /wan-face-swaps/generations/{id}","href":"/api-reference/wan/image-generation/face-swap/tasks"},{"title":"Delete a Wan face swap task","sidebarTitle":"Delete task","openapi":"openapi/wan-face-swap.yaml DELETE /wan-face-swaps/generations/{id}","href":"/api-reference/wan/image-generation/face-swap/tasks-delete"}]}]},{"group":"Standard","pages":[{"group":"Video API","pages":[{"title":"Create Wan video task","sidebarTitle":"Create task","openapi":"openapi/wan-standard-video.yaml POST /contents/generations/tasks","href":"/api-reference/wan/standard/video-generation/create-task"},{"title":"Retrieve Wan video task","sidebarTitle":"Retrieve task","openapi":"openapi/wan-standard-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/wan/standard/video-generation/retrieve-task"},{"title":"Cancel Wan video task","sidebarTitle":"Cancel task","openapi":"openapi/wan-standard-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/wan/standard/video-generation/cancel-task"}]}]}]},{"group":"Qwen","pages":[{"group":"Image API","pages":[{"title":"Generate or edit images with Qwen Image 3.0","sidebarTitle":"Qwen Image 3.0","openapi":"openapi/qwen-image-3.yaml POST /qwen-images/generations","href":"/api-reference/qwen/image-generation/qwen-image-3-0"},{"title":"Create a Qwen image edit task","sidebarTitle":"Create image edit task","openapi":"openapi/qwen-image-edit.yaml POST /qwen-image-edits/generations","href":"/api-reference/qwen/image-generation/qwen-image-edit"},{"title":"Retrieve a Qwen image edit task","sidebarTitle":"Retrieve task","openapi":"openapi/qwen-image-edit.yaml GET /qwen-image-edits/generations/{id}","href":"/api-reference/qwen/image-generation/qwen-image-edit/tasks"},{"title":"Delete a Qwen image edit task","sidebarTitle":"Delete task","openapi":"openapi/qwen-image-edit.yaml DELETE /qwen-image-edits/generations/{id}","href":"/api-reference/qwen/image-generation/qwen-image-edit/tasks-delete"}]}]},{"group":"ElevenLabs","pages":[{"title":"Audio API","href":"/api-reference/elevenlabs/overview"},{"group":"Voices","pages":[{"group":"Create voices","pages":[{"title":"Clone a voice from recordings","openapi":"openapi/audio.yaml POST /audio/voices/clone","href":"/api-reference/elevenlabs/clone-voice"},{"title":"Estimate voice design cost","openapi":"openapi/audio.yaml POST /audio/voice-designs/estimate","href":"/api-reference/elevenlabs/estimate-voice-design"},{"title":"Voice Design v3","openapi":"openapi/audio.yaml POST /audio/voice-designs","href":"/api-reference/elevenlabs/voice-designs"},{"title":"Save a Voice Design candidate","openapi":"openapi/audio.yaml POST /audio/voice-designs/{generationId}/save","href":"/api-reference/elevenlabs/save-candidate"},{"title":"Check a pending voice creation","openapi":"openapi/audio.yaml GET /audio/voice-operations/{operationId}","href":"/api-reference/elevenlabs/get-voice-operation"}]},{"group":"Find and manage voices","pages":[{"title":"List voices","openapi":"openapi/audio.yaml GET /audio/voices","href":"/api-reference/elevenlabs/voices"},{"title":"Get a voice","openapi":"openapi/audio.yaml GET /audio/voices/{voiceId}","href":"/api-reference/elevenlabs/get-voice"},{"title":"Favorite a public voice","openapi":"openapi/audio.yaml PUT /audio/voices/{voiceId}/favorite","href":"/api-reference/elevenlabs/favorite-voice"},{"title":"Unfavorite a public voice","openapi":"openapi/audio.yaml DELETE /audio/voices/{voiceId}/favorite","href":"/api-reference/elevenlabs/unfavorite-voice"},{"title":"Delete a private voice","openapi":"openapi/audio.yaml DELETE /audio/voices/{voiceId}","href":"/api-reference/elevenlabs/delete-voice"}]}]},{"group":"Speech and dialogue","pages":[{"title":"List audio models","openapi":"openapi/audio.yaml GET /audio/models","href":"/api-reference/elevenlabs/models"},{"title":"Speech language codes","href":"/api-reference/elevenlabs/language-codes"},{"title":"Estimate audio price","openapi":"openapi/audio.yaml POST /audio/estimate","href":"/api-reference/elevenlabs/estimate"},{"title":"Generate speech audio","openapi":"openapi/audio.yaml POST /audio/speech","href":"/api-reference/elevenlabs/speech"},{"title":"Create dialogue","href":"/api-reference/elevenlabs/dialogue"},{"title":"Create audio generation","openapi":"openapi/audio.yaml POST /audio/generations","href":"/api-reference/elevenlabs/create-generation"},{"title":"List audio generations","openapi":"openapi/audio.yaml GET /audio/generations","href":"/api-reference/elevenlabs/list-generations"},{"title":"Get audio generation","openapi":"openapi/audio.yaml GET /audio/generations/{id}","href":"/api-reference/elevenlabs/get-generation"}]},{"group":"Realtime connections","pages":[{"title":"Create realtime session","openapi":"openapi/audio.yaml POST /audio/realtime/sessions","href":"/api-reference/elevenlabs/create-session"},{"title":"Get realtime session","openapi":"openapi/audio.yaml GET /audio/realtime/sessions/{id}","href":"/api-reference/elevenlabs/get-session"},{"title":"Create reconnection ticket","openapi":"openapi/audio.yaml POST /audio/realtime/sessions/{id}/tokens","href":"/api-reference/elevenlabs/create-token"},{"title":"Close realtime session","openapi":"openapi/audio.yaml DELETE /audio/realtime/sessions/{id}","href":"/api-reference/elevenlabs/close-session"}]},{"group":"Webhooks","pages":[{"title":"Create webhook endpoint","openapi":"openapi/audio.yaml POST /webhook-endpoints","href":"/api-reference/elevenlabs/create-webhook"},{"title":"List webhook endpoints","openapi":"openapi/audio.yaml GET /webhook-endpoints","href":"/api-reference/elevenlabs/list-webhooks"},{"title":"Update webhook endpoint","openapi":"openapi/audio.yaml PATCH /webhook-endpoints/{id}","href":"/api-reference/elevenlabs/update-webhook"},{"title":"Disable webhook endpoint","openapi":"openapi/audio.yaml DELETE /webhook-endpoints/{id}","href":"/api-reference/elevenlabs/disable-webhook"},{"title":"Rotate webhook secret","openapi":"openapi/audio.yaml POST /webhook-endpoints/{id}/rotate-secret","href":"/api-reference/elevenlabs/rotate-secret"},{"title":"List webhook deliveries","openapi":"openapi/audio.yaml GET /webhook-endpoints/{id}/deliveries","href":"/api-reference/elevenlabs/deliveries"},{"title":"Retry a failed delivery","openapi":"openapi/audio.yaml POST /webhook-endpoints/{id}/deliveries/{deliveryId}/retry","href":"/api-reference/elevenlabs/retry-delivery"}]}]},{"group":"Higgsfield","pages":[{"group":"Genjutsu","pages":[{"title":"Genjutsu","href":"/api-reference/higgsfield/genjutsu/overview"},{"title":"Motion Transfer","href":"/api-reference/higgsfield/genjutsu/motion-transfer"},{"title":"Object Swap","href":"/api-reference/higgsfield/genjutsu/object-swap"},{"title":"Restyle","href":"/api-reference/higgsfield/genjutsu/restyle"},{"title":"Create a Genjutsu task","openapi":"openapi/genjutsu-video.yaml POST /contents/generations/tasks","href":"/api-reference/higgsfield/genjutsu/create-task"},{"title":"List Genjutsu styles","openapi":"openapi/genjutsu-video.yaml GET /video/genjutsu/styles","href":"/api-reference/higgsfield/genjutsu/styles"},{"title":"Retrieve a Genjutsu task","openapi":"openapi/genjutsu-video.yaml GET /contents/generations/tasks/{id}","href":"/api-reference/higgsfield/genjutsu/retrieve-task"},{"title":"Cancel a Genjutsu task","openapi":"openapi/genjutsu-video.yaml DELETE /contents/generations/tasks/{id}","href":"/api-reference/higgsfield/genjutsu/cancel-task"}]}]}]},{"tab":"Help","pages":[{"title":"Help","href":"/helpful-tips"}]}]},"basePath":"","title":"Chat - GENGEN API","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}