Jupyter Kernel Messaging Protocol
WebSocket-based messaging protocol for communication between Jupyter clients and computational kernels. Supports code execution, introspection, completion, and rich output over shell, IOPub, stdin, and control channels.
Jupyter Kernel Messaging Protocol is one of 14 APIs that Jupyter Notebook publishes on the APIs.io network, described by an AsyncAPI event-driven specification.
This API exposes 1 JSON Schema definition.
Tagged areas include Kernels, Messaging, Real-Time, and WebSocket. The published artifact set on APIs.io includes API documentation, an AsyncAPI specification, and 1 JSON Schema.
This event API exposes
2 operations
across 1 channel,
and defines 58 schemas.
It is described by AsyncAPI 2.6.0, at version 5.4.0.
The API connects through a single server, ws://localhost:8888/api/kernels/{kernel_id}/channels (ws).
The identity and technical contract details declared by the specification.
ExecuteRequest
message
Request to execute code in the kernel.
ExecuteReply
message
Reply to an execute request with status and execution count.
InspectRequest
message
Request to inspect an object at cursor position.
InspectReply
message
Reply with object inspection results.
CompleteRequest
message
Request code completion suggestions.
CompleteReply
message
Reply with code completion matches.
HistoryRequest
message
Request execution history from the kernel.
HistoryReply
message
Reply with execution history entries.
IsCompleteRequest
message
Check if code is complete and ready to execute.
IsCompleteReply
message
Reply indicating whether code is complete.
KernelInfoRequest
message
Request information about the kernel.
KernelInfoReply
message
Reply with kernel implementation and language information.
ShutdownRequest
message
Request the kernel to shut down.
ShutdownReply
message
Reply confirming kernel shutdown.
InterruptRequest
message
Request to interrupt the kernel.
InputRequest
message
Kernel requests input from the frontend (e.g., for Python's input() function).
InputReply
message
Frontend sends user input to the kernel.
ExecuteInput
message
Broadcast of code being executed (for all connected clients).
ExecuteResult
message
Result of an execution, equivalent to the Out[] prompt in IPython. Contains rich display data.
StreamOutput
message
Standard output or standard error stream data from code execution.
DisplayData
message
Rich display data output from code execution, supporting multiple MIME types.
UpdateDisplayData
message
Update a previous displaydata output.
ErrorOutput
message
Error output from failed code execution.
StatusBroadcast
message
Kernel execution state broadcast. Published on every state change (busy, idle, starting).
ClearOutput
message
Request to clear output area in the frontend.
CommOpen
message
Open a comm channel for custom messaging (e.g., widgets).
CommMsg
message
Send a message on an open comm channel.
CommClose
message
Close a comm channel.
CommOpenReply
message
Kernel opens a comm channel to the frontend.
CommMsgReply
message
Kernel sends a message on an open comm channel.
CommCloseReply
message
Kernel closes a comm channel.
DebugReply
message
Reply to a debug request.
DebugEvent
message
Debug event broadcast from the kernel.
KernelMessage
object
A Jupyter kernel message envelope. All messages follow this structure with a header, parentheader, metadata, content, and optional buffers.
6 properties
4 required
MessageHeader
object
Header for a Jupyter kernel message.
6 properties
6 required
ExecuteRequestContent
object
Content for an executerequest message.
6 properties
1 required
ExecuteReplyContent
object
Content for an executereply message.
7 properties
2 required
InspectRequestContent
object
Content for an inspectrequest message.
3 properties
2 required
InspectReplyContent
object
Content for an inspectreply message.
4 properties
2 required
CompleteRequestContent
object
Content for a completerequest message.
2 properties
2 required
CompleteReplyContent
object
Content for a completereply message.
5 properties
4 required
HistoryRequestContent
object
Content for a historyrequest message.
9 properties
3 required
HistoryReplyContent
object
Content for a historyreply message.
2 properties
2 required
IsCompleteRequestContent
object
Content for an iscompleterequest message.
1 property
1 required
IsCompleteReplyContent
object
Content for an iscompletereply message.
2 properties
1 required
KernelInfoReplyContent
object
Content for a kernelinforeply message.
8 properties
6 required
ShutdownContent
object
Content for shutdownrequest and shutdownreply messages.
1 property
1 required
InputRequestContent
object
Content for an inputrequest message.
2 properties
2 required
InputReplyContent
object
Content for an inputreply message.
1 property
1 required
StreamContent
object
Content for a stream message (stdout/stderr).
2 properties
2 required
DisplayDataContent
object
Content for displaydata and updatedisplaydata messages.
3 properties
2 required
ExecuteResultContent
object
Content for an executeresult message.
3 properties
3 required
ErrorContent
object
Content for an error message.
3 properties
3 required
StatusContent
object
Content for a status message.
1 property
1 required
ClearOutputContent
object
Content for a clearoutput message.
1 property
1 required
CommOpenContent
object
Content for a commopen message.
3 properties
2 required
CommMsgContent
object
Content for a commmsg message.
2 properties
2 required
CommCloseContent
object
Content for a commclose message.
2 properties
1 required
The full machine-readable AsyncAPI contract behind this narrative.
Other APIs Jupyter Notebook publishes across the network.