Try Bifrost Enterprise free for 14 days. Explore now
curl --request POST \
--url http://localhost:8080/bedrock/model/{modelId}/converse-stream \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "user",
"content": [
{
"text": "<string>",
"image": {
"format": "jpeg",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk="
}
},
"document": {
"format": "pdf",
"name": "<string>",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk=",
"text": "<string>"
}
},
"toolUse": {
"toolUseId": "<string>",
"name": "<string>",
"input": {}
},
"toolResult": {
"toolUseId": "<string>",
"content": [
{
"text": "<string>",
"image": {
"format": "jpeg",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk="
}
},
"document": {
"format": "pdf",
"name": "<string>",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk=",
"text": "<string>"
}
},
"toolUse": {
"toolUseId": "<string>",
"name": "<string>",
"input": {}
},
"toolResult": "<unknown>",
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"reasoningContent": {
"reasoningText": {
"text": "<string>",
"signature": "<string>"
}
},
"json": {},
"cachePoint": {
"type": "default"
}
}
],
"status": "success"
},
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"reasoningContent": {
"reasoningText": {
"text": "<string>",
"signature": "<string>"
}
},
"json": {},
"cachePoint": {
"type": "default"
}
}
]
}
],
"system": [
{
"text": "<string>",
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"cachePoint": {
"type": "default"
}
}
],
"inferenceConfig": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"stopSequences": [
"<string>"
]
},
"toolConfig": {
"tools": [
{
"toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": {
"json": {}
}
},
"cachePoint": {
"type": "default"
}
}
],
"toolChoice": {
"auto": {},
"any": {},
"tool": {
"name": "<string>"
}
}
},
"guardrailConfig": {
"guardrailIdentifier": "<string>",
"guardrailVersion": "<string>",
"trace": "enabled"
},
"additionalModelRequestFields": {},
"additionalModelResponseFieldPaths": [
"<string>"
],
"performanceConfig": {
"latency": "standard"
},
"promptVariables": {},
"requestMetadata": {},
"serviceTier": {
"type": "reserved"
},
"fallbacks": [
"<string>"
]
}
'{
"role": "<string>",
"contentBlockIndex": 123,
"delta": {
"text": "<string>",
"reasoningContent": {
"text": "<string>",
"signature": "<string>"
},
"toolUse": {
"input": "<string>"
}
},
"stopReason": "<string>",
"start": {
"toolUse": {
"toolUseId": "<string>",
"name": "<string>"
}
},
"usage": {
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"cacheReadInputTokens": 123,
"cacheWriteInputTokens": 123
},
"metrics": {
"latencyMs": 123
},
"trace": {},
"additionalModelResponseFields": {},
"invokeModelRawChunk": "aSDinaTvuI8gbWludGxpZnk="
}Streams messages from a model using AWS Bedrock Converse API format.
curl --request POST \
--url http://localhost:8080/bedrock/model/{modelId}/converse-stream \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "user",
"content": [
{
"text": "<string>",
"image": {
"format": "jpeg",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk="
}
},
"document": {
"format": "pdf",
"name": "<string>",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk=",
"text": "<string>"
}
},
"toolUse": {
"toolUseId": "<string>",
"name": "<string>",
"input": {}
},
"toolResult": {
"toolUseId": "<string>",
"content": [
{
"text": "<string>",
"image": {
"format": "jpeg",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk="
}
},
"document": {
"format": "pdf",
"name": "<string>",
"source": {
"bytes": "aSDinaTvuI8gbWludGxpZnk=",
"text": "<string>"
}
},
"toolUse": {
"toolUseId": "<string>",
"name": "<string>",
"input": {}
},
"toolResult": "<unknown>",
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"reasoningContent": {
"reasoningText": {
"text": "<string>",
"signature": "<string>"
}
},
"json": {},
"cachePoint": {
"type": "default"
}
}
],
"status": "success"
},
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"reasoningContent": {
"reasoningText": {
"text": "<string>",
"signature": "<string>"
}
},
"json": {},
"cachePoint": {
"type": "default"
}
}
]
}
],
"system": [
{
"text": "<string>",
"guardContent": {
"text": {
"text": "<string>",
"qualifiers": [
"<string>"
]
}
},
"cachePoint": {
"type": "default"
}
}
],
"inferenceConfig": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"stopSequences": [
"<string>"
]
},
"toolConfig": {
"tools": [
{
"toolSpec": {
"name": "<string>",
"description": "<string>",
"inputSchema": {
"json": {}
}
},
"cachePoint": {
"type": "default"
}
}
],
"toolChoice": {
"auto": {},
"any": {},
"tool": {
"name": "<string>"
}
}
},
"guardrailConfig": {
"guardrailIdentifier": "<string>",
"guardrailVersion": "<string>",
"trace": "enabled"
},
"additionalModelRequestFields": {},
"additionalModelResponseFieldPaths": [
"<string>"
],
"performanceConfig": {
"latency": "standard"
},
"promptVariables": {},
"requestMetadata": {},
"serviceTier": {
"type": "reserved"
},
"fallbacks": [
"<string>"
]
}
'{
"role": "<string>",
"contentBlockIndex": 123,
"delta": {
"text": "<string>",
"reasoningContent": {
"text": "<string>",
"signature": "<string>"
},
"toolUse": {
"input": "<string>"
}
},
"stopReason": "<string>",
"start": {
"toolUse": {
"toolUseId": "<string>",
"name": "<string>"
}
},
"usage": {
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"cacheReadInputTokens": 123,
"cacheWriteInputTokens": 123
},
"metrics": {
"latencyMs": 123
},
"trace": {},
"additionalModelResponseFields": {},
"invokeModelRawChunk": "aSDinaTvuI8gbWludGxpZnk="
}Model ID (e.g., anthropic.claude-3-sonnet-20240229-v1:0)
Array of messages for the conversation
Show child attributes
System messages/prompts
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Model-specific parameters
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Successful streaming response
Flat structure for streaming events matching actual Bedrock API response
For messageStart events
For content block events
Show child attributes
For messageStop events
Show child attributes
Show child attributes
Show child attributes
Raw bytes for legacy invoke stream
Was this page helpful?