You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
I just want to flag that certain malformed requests leak error messages that show more information about the API than they should. Nothing serious but I wanted to flag.
{
"model": "sonar-pro",
"messages": [
{
"role": "system",
"content": "Provide clear, structured responses with an explanation and practical examples."
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Could you tell me more about this image? "},
{
"type": "image_url",
"content" : "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Vincent_Willem_van_Gogh_127.jpg/1920px-Vincent_Willem_van_Gogh_127.jpg"
}
]
}
],
"max_tokens": "125"
}
...leaks info on the Pydantic models for the types of accepted content and the expected fields.
{
"error": {
"message": "[\"At body -> messages -> 1 -> content -> str: Input should be a valid string\", \"At body -> messages -> 1 -> content -> list[union[ChatMessageContentTextChunk,ChatMessageContentImageChunk,ChatMessageContentPDFChunk]] -> 1 -> ChatMessageContentTextChunk -> type: Input should be 'text'\", \"At body -> messages -> 1 -> content -> list[union[ChatMessageContentTextChunk,ChatMessageContentImageChunk,ChatMessageContentPDFChunk]] -> 1 -> ChatMessageContentTextChunk -> text: Field required\", \"At body -> messages -> 1 -> content -> list[union[ChatMessageContentTextChunk,ChatMessageContentImageChunk,ChatMessageContentPDFChunk]] -> 1 -> ChatMessageContentImageChunk -> image_url: Field required\", \"At body -> messages -> 1 -> content -> list[union[ChatMessageContentTextChunk,ChatMessageContentImageChunk,ChatMessageContentPDFChunk]] -> 1 -> ChatMessageContentPDFChunk -> type: Input should be 'pdf_url'\", \"At body -> messages -> 1 -> content -> list[union[ChatMessageContentTextChunk,ChatMessageContentImageChunk,ChatMessageContentPDFChunk]] -> 1 -> ChatMessageContentPDFChunk -> pdf_url: Field required\"]",
"type": "bad_request",
"code": 400
}
}
This request uses the syntax that's in the regex structure output section of the API docs. The example with an r string is invalid when the request is made directly.
Edit: It was non-authenticated; when authenticated, it returns a json decode error at r"
{
"model": "sonar-pro",
"messages": [
{
"role": "system",
"content": "Provide clear, structured responses with an explanation and practical examples."
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Could you tell me more about this image? "},
]
}
],
"max_tokens": "125",
"response_format": {
"type": "regex",
"regex": {"regex": r"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"},
},
}
and returns version info on the infrastructure (openresty, WAF).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just want to flag that certain malformed requests leak error messages that show more information about the API than they should. Nothing serious but I wanted to flag.
...leaks info on the Pydantic models for the types of accepted content and the expected fields.
This request uses the syntax that's in the regex structure output section of the API docs. The example with an r string is invalid when the request is made directly.
Edit: It was non-authenticated; when authenticated, it returns a json decode error at
r"
and returns version info on the infrastructure (openresty, WAF).
Beta Was this translation helpful? Give feedback.
All reactions