From 331eab81f785b08eabc41e320f59c45c42a7d73f Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 13 Aug 2025 06:44:34 -0700 Subject: [PATCH 1/2] mtmd: Explain base64 inputs in the API docs --- docs/12 - OpenAI API.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/12 - OpenAI API.md b/docs/12 - OpenAI API.md index fd3309c7..f85991f4 100644 --- a/docs/12 - OpenAI API.md +++ b/docs/12 - OpenAI API.md @@ -97,6 +97,8 @@ curl http://127.0.0.1:5000/v1/chat/completions \ }' ``` +For base64-encoded images, just replace the inner "url" value with the base64 string, formatted as `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the image type (image/png, image/jpeg, image/gif, etc.) and BASE64_STRING is your encoded image. + ##### With /v1/completions ```shell @@ -129,6 +131,8 @@ curl http://127.0.0.1:5000/v1/completions \ }' ``` +For base64-encoded images, just replace the inner "url" values with the base64 strings, formatted as `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the image type (image/png, image/jpeg, image/gif, etc.) and BASE64_STRING is your encoded image. + #### SSE streaming ```shell From 725a8bcf60dd769aa2d62760750c74b772f9f504 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 13 Aug 2025 06:49:28 -0700 Subject: [PATCH 2/2] Small docs change --- docs/12 - OpenAI API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/12 - OpenAI API.md b/docs/12 - OpenAI API.md index f85991f4..83bba41f 100644 --- a/docs/12 - OpenAI API.md +++ b/docs/12 - OpenAI API.md @@ -97,7 +97,7 @@ curl http://127.0.0.1:5000/v1/chat/completions \ }' ``` -For base64-encoded images, just replace the inner "url" value with the base64 string, formatted as `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the image type (image/png, image/jpeg, image/gif, etc.) and BASE64_STRING is your encoded image. +For base64-encoded images, just replace the inner "url" value with this format: `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the file type (png, jpeg, gif, etc.) and BASE64_STRING is your base64-encoded image data. ##### With /v1/completions @@ -131,7 +131,7 @@ curl http://127.0.0.1:5000/v1/completions \ }' ``` -For base64-encoded images, just replace the inner "url" values with the base64 strings, formatted as `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the image type (image/png, image/jpeg, image/gif, etc.) and BASE64_STRING is your encoded image. +For base64-encoded images, just replace the inner "url" values with this format: `data:image/FORMAT;base64,BASE64_STRING` where FORMAT is the file type (png, jpeg, gif, etc.) and BASE64_STRING is your base64-encoded image data. #### SSE streaming