initialize request per transport connection before invoking any other method, then acknowledge with an initialized notification.
Initialization Handshake
The server returns the user agent string it will present to upstream services. Subsequent requests issued before initialization receive a"Not initialized" error, and repeated initialize calls on the same connection receive an "Already initialized" error.
Request
Method
Parameters
Client identification information
Client capability flags
Response
User agent string the server will present to upstream services
Examples
Basic Initialization
With Experimental API & Notification Opt-out
Experimental API
Some app-server methods and fields are gated behind an experimental capability with no backwards-compatible guarantees.Stable surface only (default): No opt-in, no experimental methods/fields exposed.Experimental surface: Set
capabilities.experimentalApi: true during initialization.Without Opt-in
If a request uses an experimental method or field without opting in, the server rejects it with a JSON-RPC error:mock/experimentalMethod(method-level gate)thread/start.mockExperimentalField(field-level gate)
Schema Generation
Generate stable vs experimental schemas:Notification Opt-out
Clients can suppress specific notifications per connection by sending exact method names incapabilities.optOutNotificationMethods.
Behavior:
- Exact-match only:
item/agentMessage/deltasuppresses only that method - Unknown method names are ignored
- Applies to both legacy (
codex/event/*) and v2 (thread/*,turn/*,item/*) notifications - Does not apply to requests/responses/errors
- Opt out of legacy session setup event:
codex/event/session_configured - Opt out of streamed agent text deltas:
item/agentMessage/delta
Next Steps
Threads
Start or resume a conversation thread