NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1665 most downloaded on pub.dev
Dart client for the OpenAI REST APIs and realtime WebSocket/WebRTC workflows with type-safe access to GPT, image, audio, and Responses APIs.
Last release 3 days ago
04 Oct 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
71 releases · first in 2023
Fixes Responses parsing for compatible providers such as Agnes that return prompt_tokens and completion_tokens, preserving their reported counts and c
Fixes Responses parsing for compatible providers such as Agnes that return prompt_tokens and completion_tokens, preserving their reported counts and cached/reasoning token details. Standard Responses fields take precedence when present, and serialization continues to use standard Responses field names.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds GPT Image 2.5 Sunburst and Flare, including their dated snapshots, plus xhigh/max quality for image generation and editing. ImageSize becomes an immutable value class that accepts custom resolutions and preserves custom, transient, and future sizes in ordinary and streaming responses. Existing size constants remain available, but enum-only APIs and exhaustive size/quality switches require migration; see the Migration Guide.
One column per quarter.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Requires Dart 3.12 or later; upgrade your Dart SDK or the Dart SDK bundled with Flutter before updating this package.
ReasoningDetail now round-trips OpenRouter reasoning_details payloads exactly — explicit null values, nested unknown data, and ordered detail chunks a
ReasoningDetail now round-trips OpenRouter reasoning_details payloads exactly — explicit null values, nested unknown data, and ordered detail chunks all survive parsing and re-serialization, which OpenRouter requires when reasoning is replayed between requests. The type also exposes typed id, format, index, summary, and signature fields plus a ReasoningDetail.withAdditionalProperties factory for future non-reserved fields, stream accumulation retains explicitly empty reasoning arrays, and ChatDelta equality and hashing now account for tool calls and reasoning details.
Fixes a LinkedHashMap failure on Dart 3.13.2 that broke streaming multipart requests. The client added a JSON content-type header and later removed it
Fixes a LinkedHashMap failure on Dart 3.13.2 that broke streaming multipart requests. The client added a JSON content-type header and later removed it, and MultipartRequest.finalize() reinserting the same case-insensitive key then threw. Streaming multipart requests now build their headers directly and add the required SSE Accept header, leaving the generated multipart boundary owned by package:http.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds Fast mode (ServiceTier.fast, up to 2.5× faster processing, replacing Priority Processing) and a full modernization of the GPT-Transcribe generation — chunking strategy control, logprobs, keyword hints, multi-language input, speaker diarization, and new createStream()/createDiarized()/createRaw() methods on client.audio.transcriptions. Also adds a client.contentProvenanceChecks resource for detecting OpenAI C2PA and SynthID provenance signals, and syncs the pinned spec to GPT-5.6 with programmatic tool calling, explicit prompt caching, and a multi-agent Responses beta. Breaking: TranscriptionResponseFormat is renamed to AudioResponseFormat (a deprecated typedef keeps old code compiling), TranslationRequest.responseFormat now uses a dedicated TranslationResponseFormat enum, TranscriptionVerboseResponse.task is now String?, InputAudioTranscriptionCompletedEvent.usage is now a typed TranscriptUsage?, and multipart array fields switch to spec-correct bracket-repeated encoding. See the Migration Guide.
Fixes buildUrl collapsing repeated query keys carried by the base URL (?k=a&k=b) to the last value — a proxy/gateway base URL with duplicate keys now
Fixes buildUrl collapsing repeated query keys carried by the base URL (?k=a&k=b) to the last value — a proxy/gateway base URL with duplicate keys now keeps all of them on every request. Single-value behavior (including Azure api-version handling) is unchanged.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Syncs openai_dart to the latest OpenAI OpenAPI spec. Adds a reasoning context mode — ReasoningConfig.context (new ReasoningContext enum: auto/currentTurn/allTurns) controls which reasoning items are rendered back to the model on later turns, and the effective mode is now surfaced on the response (which also carries reasoning + truncation, so it's no longer silently dropped). Also adds MCP Secure Tunnel and connector addressing for remote MCP tools via McpTool.tunnelId and McpTool.connectorId. The single breaking change has limited real-world impact: to express the spec's server_url/connector_id/tunnel_id one-of, McpTool.serverUrl is now nullable (String?) — existing code that always passed serverUrl continues to compile and behave the same; only callers that read McpTool.serverUrl must now handle null. See the Migration Guide.
All new fields are additive and nullable. Also marks the image-model id constants OpenAI has deprecated or removed with @Deprecated (retained for comp…
Adds support for the new moderation scores feature on the Chat Completions and Responses APIs — pass a moderation object on a request to receive moderation results for both the model input and the generated output, surfaced as sealed input/output outcomes (ChatCompletion.moderation, ChatStreamEvent.moderation, Response.moderation) and captured by ChatStreamAccumulator for streaming. All new fields are additive and nullable. Also marks the image-model id constants OpenAI has deprecated or removed with @Deprecated (retained for compatibility), leaving ImageModels.gptImage2 as the only recommended image model, and refreshes the canonical spec.
Adds two new OpenAI Responses features from the latest spec: the additional_tools item — surfacing extra tool definitions mid-conversation — across th
Adds two new OpenAI Responses features from the latest spec: the additional_tools item — surfacing extra tool definitions mid-conversation — across the input, output, and conversation-item unions, and a personality style preset on the input-token-count request (responses.inputTokens.count), modeled as a sealed Personality type with friendly/pragmatic presets plus a custom(...) escape hatch for forward compatibility. Also completes the MessageRole enum with the spec's critic, discriminator, and tool values, which previously collapsed to unknown.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Migrates the Realtime API client to the GA shape from OpenAI's Voice Intelligence drop (2026-05-07): a nested audio.{input,output} config block, sealed unions for audio formats / turn detection / truncation / tracing, new RealtimeReasoning, parallelToolCalls, transcription delay, and the realtime translation surface (gpt-realtime-translate + gpt-realtime-whisper) via connectTranslation(...) and the new client-secret methods. Adds DX helpers RealtimeConnection.sendUserMessage(text) and appendAudioBytes(...), plus a lenient event parser that returns UnknownRealtimeEvent instead of throwing. Also adds an optional serviceTier and a typed CompactionTriggerItem to the /responses/compact surface. Breaking: the impact is confined to the Realtime API (client.realtime / client.realtimeSessions) — audio fields moved under audio.{input,output}, several enums became sealed unions (RealtimeAudioFormats, RealtimeAudioInputTurnDetection), the legacy create()/createTranscription() HTTP methods are replaced by client-secret flows, and spec-dropped fields (RealtimeSession.temperature, RealtimeSessionCreateResponse.clientSecret) are removed. The Chat Completions and Responses APIs are unaffected.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds support for GPT-5.5 (gpt-5.5 and the gpt-5.5-2026-04-23 snapshot) across the ChatModel enum and all examples, and exposes the new prompt_cache_retention field on the /v1/responses/{response_id}/compact endpoint via CompactResponseRequest. Also fixes a StateError that affected non-streaming requests using abortTrigger (#209). Breaking: FunctionCallStatus is realigned to match the OpenAI spec (inProgress/completed/incomplete) — the non-spec failed value is removed (#208). The breaking surface is intentionally small: any code that referenced FunctionCallStatus.failed was already rejected by the API at runtime, so the practical impact is limited — but we follow strict semver and ship the enum change as a major bump regardless.
Adds support for GPT Image 2 (gpt-image-2) — surfacing the full GPT-image parameter surface on ImageGenerationRequest and ImageEditRequest (background
Adds support for GPT Image 2 (gpt-image-2) — surfacing the full GPT-image parameter surface on ImageGenerationRequest and ImageEditRequest (background, moderation, output format/compression, streaming, input fidelity), expanded ImageQuality and ImageSize enums, token-based usage metadata on ImageResponse, and a new ImageModels constants class. Also expands the ReasoningEffort enum with none, minimal, and xhigh to match the latest OpenAI spec and the per-model support matrix for gpt-5.1, gpt-5-pro, and models after gpt-5.1-codex-max.
Re-introduces the detail field on InputFileContent via a new FileInputDetail enum (high/low) for controlling how thoroughly the model processes file i
Re-introduces the detail field on InputFileContent via a new FileInputDetail enum (high/low) for controlling how thoroughly the model processes file inputs, following the same pattern as the existing ImageDetail enum. Also refreshes the OpenAPI spec to the latest upstream version.
Adds a phase property to ConversationMessageItem to match the latest OpenAI spec. The field labels assistant messages as either commentary (intermedia
Adds a phase property to ConversationMessageItem to match the latest OpenAI spec. The field labels assistant messages as either commentary (intermediate thinking) or final_answer, which prevents performance degradation when resending conversation history to models like gpt-5.3-codex.
Aligns the README layout by moving the coding-agents TIP callout to the standard position after badges and description.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Adds FileContentPart and RefusalContentPart to the Chat Completions API — completing the content part union with support for sending PDFs/documents and representing model refusals. The InputFileContent.data() and InputContent.fileData() factories now require a mediaType parameter and construct proper data URL format (raw base64 was rejected by the API). Also adds ToolChoiceAllowedTools and ToolChoiceCustom variants for constraining tool selection, and narrows InputTokensResource.count toolChoice from Object? to ResponseToolChoice?.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Replaces the ServiceTier enum with an extensible class to preserve provider-specific tier values on round-trip serialization. Adds missing type and param fields to ResponseError and makes code nullable. Adds custom tool call support to the Responses API, modifier keys for computer use actions, and expands the Video API with edit, extend, and character endpoints. Removes FileInputDetail enum and detail parameter from InputFileContent. Also fixes toolkit verification warnings, adds docs coverage for 14 resources with new example files, standardizes equality helper locations, and adds llms.txt ecosystem files.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Made non-streaming response parsing robust for third-party OpenAI-compatible providers (AWS Bedrock proxies, Ollama, vLLM, TogetherAI, OpenRouter, etc.) by relaxing strict casts in fromJson while keeping constructor invariants strict. Added ResponseStreamExtensions for convenient stream event filtering/mapping, copyWith methods to all ResponseStreamEvent subtypes and ChatMessage/ContentPart, and updated RunStep, Message, Tool, and EmbeddingRequest models with additional fields from the latest API spec.
DOCS: Improve READMEs with badges, sponsor section, and vertex_ai deprecation (#90).
This release improves streaming error handling by detecting and surfacing errors embedded in chat and other streaming responses. It also updates model references to the latest gpt-realtime-1.5 and gpt-audio-1.5 models, and documents WebRTC support for the Realtime API.
Added missing containerId field to CodeInterpreterCallOutputItem and made ContainerFile.bytes nullable to match the API response.
Added support for GPT-5.4 and the new Responses API agent capabilities released alongside it — tool search (deferred tool loading at runtime), built-i
Added support for GPT-5.4 and the new Responses API agent capabilities released alongside it — tool search (deferred tool loading at runtime), built-in computer use, and 1M-token context with message phases. Also added multi-modal moderation, fine-tune management methods, and missing ChatCompletionCreateRequest fields. Fixed handling of unknown streaming event types.
Added baseUrl and defaultHeaders parameters to withApiKey constructors, aligned Responses API models with the latest OpenAI spec, fixed null index han
Added baseUrl and defaultHeaders parameters to withApiKey constructors, aligned Responses API models with the latest OpenAI spec, fixed null index handling in ToolCallDelta.fromJson, and improved hashCode for list fields.
Fixed Responses API model types to align with the latest OpenAI spec.
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
TL;DR: Complete reimplementation with a new architecture, minimal dependencies, resource-based API, and improved developer experience. Hand-crafted models (no code generation), interceptor-driven architecture, comprehensive error handling, full OpenAI API coverage, and alignment with the latest OpenAI OpenAPI (2026-02-19).
client.chat.completions — Chat completion creation, streamingclient.responses — Responses API (recommended unified API)client.conversations — Conversation managementclient.embeddings — Text embeddingsclient.audio.speech / audio.transcriptions / audio.translations — Audio APIsclient.images — Image generation, editing, variationsclient.files / client.uploads — File and large upload managementclient.batches — Batch processingclient.models — Model listing and retrievalclient.moderations — Content moderationclient.fineTuning.jobs — Fine-tuning job managementclient.beta.assistants / beta.threads / beta.vectorStores — Assistants API (Beta)client.videos — Sora video generationclient.containers — Code execution containersclient.chatkit — ChatKit sessions and threads (Beta)client.evals — Model evaluationclient.realtime — WebSocket-based Realtime APIclient.completions — Legacy text completionsAuthProvider interface (ApiKeyProvider, OrganizationApiKeyProvider, AzureApiKeyProvider).abortTrigger parameter.OpenAIConfig (timeouts, retry policy, log level, baseUrl, auth).http, logging, meta, web_socket only).copyWith using sentinel pattern.ChatMessage.user(), ChatMessage.system()).createStream() vs create())..text, .hasToolCalls, .allToolCalls).ChatStreamAccumulator and extension methods (collectText(), textDeltas(), accumulate()).client.createChatCompletion() → client.chat.completions.create()client.createChatCompletionStream() → client.chat.completions.createStream()client.createEmbedding() → client.embeddings.create()client.createImage() → client.images.generate()client.createSpeech() → client.audio.speech.create()client.createTranscription() → client.audio.transcriptions.create()client.createFineTuningJob() → client.fineTuning.jobs.create()client.uploadFile() → client.files.upload()client.createBatch() → client.batches.create()CreateChatCompletionRequest → ChatCompletionCreateRequestChatCompletionMessage.user(content: ChatCompletionUserMessageContent.string('...')) → ChatMessage.user('...')ChatCompletionMessage.system(content: '...') → ChatMessage.system('...')ChatCompletionTool(type: ..., function: FunctionObject(...)) → Tool.function(...)ChatCompletionModel.modelId('gpt-4o') → 'gpt-4o' (plain string)EmbeddingInput.string('...') → EmbeddingInput.text('...')CreateImageRequest → ImageGenerationRequestImageSize.v1024x1024 → ImageSize.size1024x1024import 'package:openai_dart/openai_dart_assistants.dart' for Assistants, Threads, Messages, Runs, Vector Storesimport 'package:openai_dart/openai_dart_realtime.dart' for Realtime APIOpenAIConfig with AuthProvider pattern:
OpenAIClient(apiKey: 'KEY') → OpenAIClient(config: OpenAIConfig(authProvider: ApiKeyProvider('KEY')))OpenAIClient.fromEnvironment() to read OPENAI_API_KEY.OpenAIClient.withApiKey('KEY') for quick setup.OpenAIClientException with typed hierarchy:
ApiException, AuthenticationException, RateLimitException, NotFoundException, RequestTimeoutException, AbortedException, ConnectionException, ParseException, StreamException.event.choices.first.delta.content → event.textDelta.map() callbacks → Dart 3 switch expressions or is type checks.Model.created, Model.ownedBy, ChatCompletion.created are now nullable for OpenAI-compatible provider support.endSession() → close().freezed, json_serializable; now minimal (http, logging, meta, web_socket).See MIGRATION.md for step-by-step examples and mapping tables.
FEAT: Fix formatting issues (#922).
FEAT: Add image streaming and new GPT image models (#827).
REFACTOR: Fix pub format warnings (#809).
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
FEAT: Migrate to Freezed v3 (#773).
FIX: Change CreateChatCompletionRequest.verbosity default value to null (#771).
FEAT: Make CreateChatCompletionStreamResponse.choices field nullable to support Groq's OpenAI-compatible API (#742).
FEAT: Make Model.object/owned_by fields nullable to support OpenRouter's OpenAI-compatible API (#736).
FEAT: Make ToolCallChunk.index field nullable to support Gemini OpenAI-compatible API (#733).
BREAKING FEAT: Align OpenAI API changes (#706).
FEAT: Support Predicted Outputs (#613).
FEAT: Add five new voice types to Chat Completions API (#594).
FEAT: Add support for audio in chat completions (#577).
DOCS: Add note about the new openai_realtime_dart client.
- DOCS: Fix typo.
FEAT: Add OpenAI o1-preview and o1-mini to model catalog (#555).
FEAT: Add support for Structured Outputs (#525).
FEAT: Add support for disabling parallel tool calls (#492).
REFACTOR: Migrate conditional imports to js_interop (#453).
FIX: Rename CreateRunRequestModel factories names (#429).
FEAT: Add GPT-4o to model catalog (#420).
FEAT: Add support for stream_options (#405).
> This release has breaking changes. See the Migration Guide for upgrade instructions.
[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions. If you are using the Assistants API v1, please refer to the OpenAI docs to see how to migrate to v2.
FEAT: Add temperature, top_p and response format to Assistants API (#384).
FEAT: Support for Batch API (#383).
FIX: Have the == implementation use Object instead of dynamic (#334).
- DOCS: Update CHANGELOG.md.
FEAT: Add gpt-4-0125-preview and gpt-4-turbo-preview in model catalog (#309).
FEAT: Remove OpenAI deprecated models (#290).
FEAT: Add support for Assistants API (#278).
FIX: Make ChatCompletionNamedToolChoice fields required (#259).
Your coding agent can read these notes before it upgrades. Set up the MCP server →