Skip to content

gpt 5 chat model names are incorrect #173

@flybayer

Description

@flybayer

TanStack AI version

v0.2.0

Framework/Library version

hono 1.19.6

Describe the bug and the steps to reproduce it

Try

  const adapter = openaiText("gpt-5.2-chat", {
    apiKey: process.env.OPENAI_API_KEY,
  })

but it fails saying the model is not available.

>>> chatStream: Fatal error during response creation <<<
>>> Error message: 400 The requested model 'gpt-5.2-chat' does not exist.
>>> Error stack: Error: 400 The requested model 'gpt-5.2-chat' does not exist.
    at APIError.generate (/Users/b/c/flightcontrol2/node_modules/.pnpm/openai@6.15.0_ws@8.17.1_zod@4.2.1/node_modules/openai/src/core/error.ts:72:14)
    at OpenAI.makeStatusError (/Users/b/c/flightcontrol2/node_modules/.pnpm/openai@6.15.0_ws@8.17.1_zod@4.2.1/node_modules/openai/src/client.ts:478:28)
    at OpenAI.makeRequest (/Users/b/c/flightcontrol2/node_modules/.pnpm/openai@6.15.0_ws@8.17.1_zod@4.2.1/node_modules/openai/src/client.ts:728:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async OpenAITextAdapter.chatStream (/Users/b/c/flightcontrol2/node_modules/.pnpm/@tanstack+ai-openai@0.2.0_@tanstack+ai@0.2.0_ws@8.17.1_zod@4.2.1/node_modules/@tanstack/ai-openai/src/adapters/text.ts:109:24)

Change to this and it works

  const adapter = openaiText("gpt-5.2-chat-latest" as "gpt-5.2-chat", {
    apiKey: process.env.OPENAI_API_KEY,
  })

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

.

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions