> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat

> Chat with GPT models using Chat Completions or Responses, including tools, files, image generation, streaming, and background work.

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.

```bash theme={"dark"}
curl https://gengen.farm/v1/models \
  -H "Authorization: Bearer $GENGEN_API_KEY"
```

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.

## SDK quickstart

> [tab] Chat Completions
>
> ```python theme={"dark"}
> import os
> from openai import OpenAI
>
> client = OpenAI(
>     api_key=os.environ["GENGEN_API_KEY"],
>     base_url="https://gengen.farm/v1",
> )
> completion = client.chat.completions.create(
>     model="gpt-6-luna",
>     messages=[{"role": "user", "content": "Explain idempotency briefly."}],
>     max_completion_tokens=1024,
> )
> print(completion.choices[0].message.content)
> ```
>
> 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.

> [tab] Responses
>
> ```python theme={"dark"}
> import os
> from openai import OpenAI
>
> client = OpenAI(
>     api_key=os.environ["GENGEN_API_KEY"],
>     base_url="https://gengen.farm/v1",
> )
> response = client.responses.create(
>     model="gpt-6.1-sol",
>     input="Explain idempotency briefly.",
>     reasoning={"effort": "medium"},
>     max_output_tokens=1024,
>     store=False,
> )
> print(response.output_text)
> ```
>
> 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](#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:

```python theme={"dark"}
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. |
| `namespace` | Groups function and custom declarations. |
| `web_search`, `web_search_preview` | OpenAI performs searches. Search options, allowed domains, citations, and tool events pass through. |
| `mcp` | 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](https://docs.gengen.farm/tool-calling.md) for application execution patterns.

## Tool examples

> [accordion] Function calling and reasoning replay
>
> For stateless conversations, preserve all output items, including
> encrypted reasoning, and return a result for every call before continuing:
>
> ```python theme={"dark"}
> 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"}'})
> ```

> [accordion] Files and File Search
>
> ```python theme={"dark"}
> import os, time
> from openai import OpenAI
> client = OpenAI(api_key=os.environ["GENGEN_API_KEY"], base_url="https://gengen.farm/v1")
>
> with open("handbook.pdf", "rb") as document:
>     file = client.files.create(file=document, purpose="assistants",
>                                extra_headers={"Idempotency-Key": "handbook-file-v1"})
> store = client.vector_stores.create(
>     name="Handbook", file_ids=[file.id],
>     extra_headers={"Idempotency-Key": "handbook-index-v1"},
> )
> while store.status == "in_progress":
>     time.sleep(1)
>     store = client.vector_stores.retrieve(store.id)
> response = client.responses.create(
>     model="gpt-6-luna", input="Summarize the vacation policy and cite the handbook.",
>     tools=[{"type": "file_search", "vector_store_ids": [store.id]}],
>     include=["file_search_call.results"], store=True,
>     extra_headers={"Idempotency-Key": "handbook-question-1"},
> )
> print(response.output_text)
> client.vector_stores.delete(store.id)
> client.files.delete(file.id)
> ```
>
> 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.

> [accordion] Code Interpreter and hosted shell
>
> ```python theme={"dark"}
> 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:
>
> ```python theme={"dark"}
> 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.

> [accordion] Image generation during chat
>
> ```python theme={"dark"}
> 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](https://docs.gengen.farm/api-reference/openai/image-generation.md) 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](https://developers.openai.com/api/reference/resources/responses/methods/create).
>
> 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](https://docs.gengen.farm/api-reference/openai/image-generation.md).

## 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. |
| Stored responses | `/v1/responses/{id}`: retrieve/delete; `/cancel`: cancel; `/input_items`: retrieve input history; streaming retrieval supports `starting_after`. |
| Service prices | `GET /v1/openai/pricing`: current final USD tool, image, session and capacity prices. |

See the [OpenAPI specification](https://docs.gengen.farm/openapi/openai-llm.yaml) for every operation's
parameters and response schema. Resource SDK examples are in [Tool examples](#tool-examples).

## Stored and background responses

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:

```python theme={"dark"}
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`.

```python theme={"dark"}
import time

response = 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`:

```python theme={"dark"}
compacted = client.responses.compact(
    model="gpt-6.1-sol",
    input=conversation_items,
)
response = client.responses.create(
    model="gpt-6.1-sol",
    input=[*compacted.output, {"role": "user", "content": "Continue."}],
    store=False,
)
```

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](https://docs.gengen.farm/pricing.md) 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](https://docs.gengen.farm/pricing.md). 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.


## OpenAPI

````yaml openapi/openai-llm.yaml POST /chat/completions
openapi: 3.1.0
info:
  title: OpenAI GPT LLMs through GENGEN
  version: 1.1.0
servers:
  - url: https://gengen.farm/api/gengen/v1
security:
  - bearerAuth: []
paths:
  /chat/completions:
    post:
      summary: Generate GPT Chat Completions
      description: >-
        Native Chat Completions with text/image messages and structured outputs.
        Astra and Sol 6.1 require Responses for tools. Sol and Luna support
        function tools only with reasoning_effort none. Standard processing,
        store false and n 1 only.
      operationId: createOpenAIGPTChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPTChatRequest'
            example:
              model: gpt-6-luna
              messages:
                - role: user
                  content: Explain idempotency briefly.
              max_completion_tokens: 1024
      responses:
        '200':
          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
                  object:
                    const: chat.completion
                  model:
                    type: string
                  choices:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                  usage:
                    type: object
                    additionalProperties: true
                additionalProperties: true
            text/event-stream:
              schema:
                type: string
        '400':
          description: >-
            Unsupported model, tool, reasoning, sampling, tier, or resource
            reference.
        '401':
          description: Invalid GENGEN API key.
        '402':
          description: Insufficient model-eligible wallet balance.
        '429':
          description: Upstream rate limit.
        '502':
          description: Provider or usage reconciliation failure.
components:
  schemas:
    GPTChatRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          $ref: '#/components/schemas/GPTModel'
        messages:
          type: array
          minItems: 1
          items:
            type: object
            additionalProperties: true
        max_completion_tokens:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 128000
        max_tokens:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 128000
          deprecated: true
        reasoning_effort:
          type:
            - string
            - 'null'
          enum:
            - none
            - low
            - medium
            - high
            - xhigh
            - max
            - null
          default: medium
        tools:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Function declarations only on Sol/Luna with reasoning_effort none.
        tool_choice:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        functions:
          type: array
          deprecated: true
          items:
            type: object
            additionalProperties: true
        function_call:
          deprecated: true
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        parallel_tool_calls:
          type:
            - boolean
            - 'null'
        response_format:
          type:
            - object
            - 'null'
          additionalProperties: true
        stream:
          type:
            - boolean
            - 'null'
          default: false
        stream_options:
          type:
            - object
            - 'null'
          additionalProperties: true
        temperature:
          type:
            - number
            - 'null'
          description: Requires reasoning_effort none.
        top_p:
          type:
            - number
            - 'null'
          description: Requires reasoning_effort none.
        logprobs:
          type:
            - boolean
            - 'null'
          description: Requires reasoning_effort none.
        top_logprobs:
          type:
            - integer
            - 'null'
          description: Requires reasoning_effort none.
        presence_penalty:
          type:
            - number
            - 'null'
        frequency_penalty:
          type:
            - number
            - 'null'
        stop:
          oneOf:
            - type: 'null'
            - type: string
            - type: array
              items:
                type: string
        seed:
          type:
            - integer
            - 'null'
        'n':
          type:
            - integer
            - 'null'
          enum:
            - 1
            - null
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        user:
          type:
            - string
            - 'null'
          description: Legacy identifier, hashed in caller scope.
        safety_identifier:
          type:
            - string
            - 'null'
        prompt_cache_key:
          type:
            - string
            - 'null'
        prompt_cache_options:
          type: object
          additionalProperties: true
        prompt_cache_retention:
          type:
            - string
            - 'null'
        service_tier:
          type:
            - string
            - 'null'
          enum:
            - auto
            - default
            - null
          description: Auto and omission use Standard processing.
        store:
          type:
            - boolean
            - 'null'
          enum:
            - false
            - null
      additionalProperties: false
    GPTModel:
      type: string
      enum:
        - gpt-6.1-sol
        - gpt-6-astra
        - gpt-6-sol
        - gpt-6-luna
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.