GET
/v1/schemas/cohere/chat/v2%2Fchat?kind=output
Accept:
Response body
0 properties · 0 required · 0 $defsThis schema isn’t a plain object with properties — showing the raw JSON instead.
application/json
{
"provider": "cohere",
"activity": "chat",
"endpointId": "v2/chat",
"kind": "output",
"contentHash": "2b44f149334b6913de390b2e288d5076ea7cf56eae2d4058699c3b232e326fb4",
"specRevision": null,
"provenance": {
"sourceUrl": "https://raw.githubusercontent.com/cohere-ai/cohere-developer-experience/main/cohere-openapi.yaml",
"sourceHash": "e567cbddb2cc3cbd6a156ba9d74213895fc4e6df55d489d401327ed177ab803b",
"fetchedAt": 1786771957,
"extractorVersion": "1",
"derivation": "upstream-spec",
"verifiedAt": null
},
"createdAt": 1786771957,
"supersededAt": null,
"schema": {
"oneOf": [
{
"$ref": "#/$defs/ChatResponseV2"
},
{
"$ref": "#/$defs/StreamedChatResponseV2"
}
],
"$defs": {
"AssistantMessageResponse": {
"type": "object",
"description": "A message from the assistant role can contain text and tool call information.",
"required": [
"role"
],
"properties": {
"role": {
"type": "string",
"enum": [
"assistant"
]
},
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/$defs/ToolCallV2"
}
},
"tool_plan": {
"type": "string",
"description": "A chain-of-thought style reflection and plan that the model generates when working with Tools."
},
"content": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/$defs/ChatTextContent"
},
{
"$ref": "#/$defs/ChatThinkingContent"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"text": "#/components/schemas/ChatTextContent",
"thinking": "#/components/schemas/ChatThinkingContent"
}
}
}
},
"citations": {
"type": "array",
"items": {
"$ref": "#/$defs/Citation"
}
}
},
"x-fern-type-name": "AssistantMessageResponse"
},
"ChatContentDeltaEvent": {
"description": "A streamed delta event which contains a delta of chat text content.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"content": {
"type": "object",
"properties": {
"thinking": {
"type": "string"
},
"text": {
"type": "string"
}
},
"x-fern-type-name": "ChatContentDeltaEventDeltaMessageContent"
}
},
"x-fern-type-name": "ChatContentDeltaEventDeltaMessage"
}
},
"x-fern-type-name": "ChatContentDeltaEventDelta"
},
"logprobs": {
"$ref": "#/$defs/LogprobItem"
}
},
"x-fern-type-name": "ChatContentDeltaEvent-3m0vqs"
}
],
"x-fern-type-name": "ChatContentDeltaEvent"
},
"ChatContentEndEvent": {
"description": "A streamed delta event which signifies that the content block has ended.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
}
},
"x-fern-type-name": "ChatContentEndEvent-ma278i"
}
],
"x-fern-type-name": "ChatContentEndEvent"
},
"ChatContentStartEvent": {
"description": "A streamed delta event which signifies that a new content block has started.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"content": {
"type": "object",
"properties": {
"thinking": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"text",
"thinking"
]
}
},
"x-fern-type-name": "ChatContentStartEventDeltaMessageContent"
}
},
"x-fern-type-name": "ChatContentStartEventDeltaMessage"
}
},
"x-fern-type-name": "ChatContentStartEventDelta"
}
},
"x-fern-type-name": "ChatContentStartEvent-6xvlq1"
}
],
"x-fern-type-name": "ChatContentStartEvent"
},
"ChatDebugEvent": {
"allOf": [
{
"$ref": "#/$defs/ChatStreamEvent"
},
{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"x-fern-audiences": [
"public"
]
}
},
"x-fern-type-name": "ChatDebugEvent-352j0t"
}
],
"x-fern-type-name": "ChatDebugEvent"
},
"ChatDocumentSource": {
"type": "object",
"description": "A document source object containing the unique identifier of the document and the document itself.",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the document"
},
"document": {
"type": "object",
"additionalProperties": true,
"x-fern-type-name": "ChatDocumentSource-w70a62"
}
},
"x-fern-type-name": "ChatDocumentSource"
},
"ChatFinishReason": {
"description": "The reason a chat request has finished.\n\n- **complete**: The model finished sending a complete message.\n- **max_tokens**: The number of generated tokens exceeded the model's context length or the value specified via the `max_tokens` parameter.\n- **stop_sequence**: One of the provided `stop_sequence` entries was reached in the model's generation.\n- **tool_call**: The model generated a Tool Call and is expecting a Tool Message in return\n- **error**: The generation failed due to an internal error\n- **timeout**: The generation was stopped because it exceeded the allowed time limit.\n",
"type": "string",
"enum": [
"COMPLETE",
"STOP_SEQUENCE",
"MAX_TOKENS",
"TOOL_CALL",
"ERROR",
"TIMEOUT"
],
"x-fern-type-name": "ChatFinishReason"
},
"ChatMessageEndEvent": {
"description": "A streamed event which signifies that the chat message has ended.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"delta": {
"type": "object",
"properties": {
"error": {
"description": "An error message if an error occurred during the generation.\n",
"type": "string",
"x-fern-audiences": [
"public"
]
},
"finish_reason": {
"x-fern-audiences": [
"public"
],
"$ref": "#/$defs/ChatFinishReason"
},
"usage": {
"x-fern-audiences": [
"public"
],
"$ref": "#/$defs/Usage"
}
},
"x-fern-type-name": "ChatMessageEndEventDelta"
}
},
"x-fern-type-name": "ChatMessageEndEvent-u3fzny"
}
],
"x-fern-type-name": "ChatMessageEndEvent"
},
"ChatMessageStartEvent": {
"description": "A streamed event which signifies that a stream has started.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the generated reply."
},
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "The role of the message.",
"enum": [
"assistant"
]
}
},
"x-fern-type-name": "ChatMessageStartEventDeltaMessage"
}
},
"x-fern-type-name": "ChatMessageStartEventDelta"
}
},
"x-fern-type-name": "ChatMessageStartEvent-lsegeq"
}
],
"x-fern-type-name": "ChatMessageStartEvent"
},
"ChatResponseV2": {
"required": [
"id",
"finish_reason",
"message"
],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the generated reply. Useful for submitting feedback."
},
"finish_reason": {
"$ref": "#/$defs/ChatFinishReason"
},
"message": {
"$ref": "#/$defs/AssistantMessageResponse"
},
"usage": {
"$ref": "#/$defs/Usage"
},
"logprobs": {
"type": "array",
"items": {
"$ref": "#/$defs/LogprobItem"
}
}
}
},
"ChatStreamEvent": {
"required": [
"event_type"
],
"properties": {
"event_type": {
"type": "string",
"x-fern-audiences": [
"public"
],
"enum": [
"stream-start",
"search-queries-generation",
"search-results",
"text-generation",
"citation-generation",
"stream-end",
"debug"
]
}
},
"x-fern-type-name": "ChatStreamEvent"
},
"ChatStreamEventType": {
"description": "The streamed event types",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"message-start",
"content-start",
"content-delta",
"content-end",
"tool-call-start",
"tool-call-delta",
"tool-call-end",
"tool-plan-delta",
"citation-start",
"citation-end",
"message-end"
]
}
},
"x-fern-type-name": "ChatStreamEventType"
},
"ChatTextContent": {
"type": "object",
"description": "Text content of the message.",
"required": [
"type",
"text"
],
"properties": {
"type": {
"type": "string",
"enum": [
"text"
]
},
"text": {
"type": "string"
}
},
"x-fern-type-name": "ChatTextContent"
},
"ChatThinkingContent": {
"type": "object",
"description": "Thinking content of the message. This will be present when `thinking` is enabled, and will contain the models internal reasoning.",
"required": [
"type",
"thinking"
],
"properties": {
"type": {
"type": "string",
"enum": [
"thinking"
]
},
"thinking": {
"type": "string"
}
}
},
"ChatToolCallDeltaEvent": {
"description": "A streamed event delta which signifies a delta in tool call arguments.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"tool_calls": {
"type": "object",
"properties": {
"function": {
"type": "object",
"properties": {
"arguments": {
"type": "string"
}
},
"x-fern-type-name": "ChatToolCallDeltaEventDeltaMessageToolCallsFunction"
}
},
"x-fern-type-name": "ChatToolCallDeltaEventDeltaMessageToolCalls"
}
},
"x-fern-type-name": "ChatToolCallDeltaEventDeltaMessage"
}
},
"x-fern-type-name": "ChatToolCallDeltaEventDelta"
}
},
"x-fern-type-name": "ChatToolCallDeltaEvent-2bxzoc"
}
],
"x-fern-type-name": "ChatToolCallDeltaEvent"
},
"ChatToolCallEndEvent": {
"description": "A streamed event delta which signifies a tool call has finished streaming.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
}
},
"x-fern-type-name": "ChatToolCallEndEvent-t6ph9s"
}
],
"x-fern-type-name": "ChatToolCallEndEvent"
},
"ChatToolCallStartEvent": {
"description": "A streamed event delta which signifies a tool call has started streaming.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"tool_calls": {
"$ref": "#/$defs/ToolCallV2"
}
},
"x-fern-type-name": "ChatToolCallStartEventDeltaMessage"
}
},
"x-fern-type-name": "ChatToolCallStartEventDelta"
}
},
"x-fern-type-name": "ChatToolCallStartEvent-lv559x"
}
],
"x-fern-type-name": "ChatToolCallStartEvent"
},
"ChatToolPlanDeltaEvent": {
"description": "A streamed event which contains a delta of tool plan text.",
"allOf": [
{
"$ref": "#/$defs/ChatStreamEventType"
},
{
"type": "object",
"properties": {
"delta": {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"tool_plan": {
"type": "string"
}
},
"x-fern-type-name": "ChatToolPlanDeltaEventDeltaMessage"
}
},
"x-fern-type-name": "ChatToolPlanDeltaEventDelta"
}
},
"x-fern-type-name": "ChatToolPlanDeltaEvent-2obfex"
}
],
"x-fern-type-name": "ChatToolPlanDeltaEvent"
},
"ChatToolSource": {
"type": "object",
"title": "Tool Output",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the document"
},
"tool_output": {
"type": "object",
"additionalProperties": true,
"x-fern-type-name": "ChatToolSource-z53ra6"
}
},
"x-fern-type-name": "ChatToolSource"
},
"Citation": {
"type": "object",
"description": "Citation information containing sources and the text cited.",
"properties": {
"start": {
"type": "integer",
"description": "Start index of the cited snippet in the original source text."
},
"end": {
"type": "integer",
"description": "End index of the cited snippet in the original source text."
},
"text": {
"type": "string",
"description": "Text snippet that is being cited."
},
"sources": {
"type": "array",
"items": {
"$ref": "#/$defs/Source"
}
},
"content_index": {
"type": "integer",
"description": "Index of the content block in which this citation appears."
},
"type": {
"$ref": "#/$defs/CitationType"
}
},
"x-fern-type-name": "Citation"
},
"CitationType": {
"type": "string",
"enum": [
"TEXT_CONTENT",
"THINKING_CONTENT",
"PLAN"
],
"description": "The type of citation which indicates what part of the response the citation is for.\n",
"x-fern-type-name": "CitationType"
},
"LogprobItem": {
"type": "object",
"required": [
"token",
"token_ids",
"logprob"
],
"properties": {
"text": {
"type": "string",
"description": "The text chunk for which the log probabilities was calculated."
},
"token_ids": {
"type": "array",
"description": "The token ids of each token used to construct the text chunk.",
"items": {
"type": "integer"
}
},
"logprobs": {
"type": "array",
"description": "The log probability of each token used to construct the text chunk.",
"items": {
"type": "number",
"format": "float"
}
}
},
"x-fern-type-name": "LogprobItem"
},
"Source": {
"description": "A source object containing information about the source of the data cited.",
"oneOf": [
{
"$ref": "#/$defs/ChatToolSource"
},
{
"$ref": "#/$defs/ChatDocumentSource"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"tool": "#/components/schemas/ChatToolSource",
"document": "#/components/schemas/ChatDocumentSource"
}
},
"x-fern-type-name": "Source"
},
"StreamedChatResponseV2": {
"description": "StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request).",
"oneOf": [
{
"$ref": "#/$defs/ChatMessageStartEvent"
},
{
"$ref": "#/$defs/ChatContentStartEvent"
},
{
"$ref": "#/$defs/ChatContentDeltaEvent"
},
{
"$ref": "#/$defs/ChatContentEndEvent"
},
{
"$ref": "#/$defs/ChatToolPlanDeltaEvent"
},
{
"$ref": "#/$defs/ChatToolCallStartEvent"
},
{
"$ref": "#/$defs/ChatToolCallDeltaEvent"
},
{
"$ref": "#/$defs/ChatToolCallEndEvent"
},
{
"$ref": "#/$defs/ChatMessageEndEvent"
},
{
"$ref": "#/$defs/ChatDebugEvent"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"message-start": "#/components/schemas/ChatMessageStartEvent",
"content-start": "#/components/schemas/ChatContentStartEvent",
"content-delta": "#/components/schemas/ChatContentDeltaEvent",
"content-end": "#/components/schemas/ChatContentEndEvent",
"tool-plan-delta": "#/components/schemas/ChatToolPlanDeltaEvent",
"tool-call-start": "#/components/schemas/ChatToolCallStartEvent",
"tool-call-delta": "#/components/schemas/ChatToolCallDeltaEvent",
"tool-call-end": "#/components/schemas/ChatToolCallEndEvent",
"citation-start": "#/components/schemas/CitationStartEvent",
"citation-end": "#/components/schemas/CitationEndEvent",
"message-end": "#/components/schemas/ChatMessageEndEvent",
"debug": "#/components/schemas/ChatDebugEvent"
}
}
},
"ToolCallV2": {
"description": "An array of tool calls to be made.",
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"function"
]
},
"function": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"arguments": {
"type": "string"
}
},
"x-fern-type-name": "ToolCallV2Function"
}
},
"x-fern-type-name": "ToolCallV2"
},
"Usage": {
"type": "object",
"properties": {
"billed_units": {
"type": "object",
"properties": {
"input_tokens": {
"type": "number",
"description": "The number of billed input tokens.\n"
},
"output_tokens": {
"type": "number",
"description": "The number of billed output tokens.\n"
},
"search_units": {
"type": "number",
"description": "The number of billed search units.\n"
},
"classifications": {
"type": "number",
"description": "The number of billed classifications units.\n"
}
},
"x-fern-type-name": "UsageBilledUnits"
},
"tokens": {
"type": "object",
"properties": {
"input_tokens": {
"type": "number",
"description": "The number of tokens used as input to the model.\n"
},
"output_tokens": {
"type": "number",
"description": "The number of tokens produced by the model.\n"
}
},
"x-fern-type-name": "UsageTokens"
},
"cached_tokens": {
"type": "number",
"description": "The number of prompt tokens that hit the inference cache.\n"
}
},
"x-fern-type-name": "Usage"
}
}
}
}Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"cohere","endpointId":"v2/chat","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}