{
    "$schema": "./provider-rules.schema.json",
    "id": "openai-chat",
    "finishReasons": {
        "chatCompletions": {
            "map": {
                "length": "length",
                "tool_calls": "tool-calls",
                "function_call": "tool-calls",
                "tool-calls": "tool-calls",
                "content_filter": "content-filter",
                "content-filter": "content-filter"
            },
            "default": "stop"
        }
    },
    "usage": {
        "input": "prompt_tokens",
        "output": "completion_tokens",
        "total": "total_tokens",
        "cacheRead": "prompt_tokens_details.cached_tokens",
        "reasoning": "completion_tokens_details.reasoning_tokens",
        "reasoningInOutput": true
    },
    "toolChoices": {
        "neurolink": {
            "modes": {
                "auto": "auto",
                "none": "none",
                "required": "required"
            },
            "acceptStrings": true,
            "acceptModeObjects": false,
            "tool": {
                "type": "function",
                "function": {
                    "name": "{toolName}"
                }
            },
            "toolRequiresName": true,
            "fallback": null
        },
        "v3": {
            "modes": {
                "auto": "auto",
                "none": "none",
                "required": "required"
            },
            "acceptStrings": false,
            "acceptModeObjects": true,
            "tool": {
                "type": "function",
                "function": {
                    "name": "{toolName}"
                }
            },
            "toolRequiresName": false,
            "fallback": null
        }
    },
    "toolNames": {
        "firstChars": "a-zA-Z_",
        "allowedChars": "a-zA-Z0-9_-",
        "maxLength": 64
    },
    "requestFields": {
        "maxTokens": "max_tokens",
        "temperature": "temperature",
        "topP": "top_p",
        "presencePenalty": "presence_penalty",
        "frequencyPenalty": "frequency_penalty",
        "seed": "seed",
        "stopSequences": "stop",
        "maxCompletionTokens": "max_completion_tokens"
    },
    "requestFieldNotes": {
        "scope": "The OpenAI Chat Completions wire, used by OpenAI, Azure OpenAI, OpenAI-compatible endpoints and every catalog provider. toWireParams() writes a request from neutral names; unset values and empty lists are left out.",
        "maxCompletionTokens": "Reasoning-class OpenAI models (o-series, gpt-5+) reject max_tokens and take the budget as max_completion_tokens. Azure moves it for models in the maxCompletionTokens family of model-families.json, and a catalog entry moves it when its maxTokensField says so."
    }
}
