# AI ## Execute AI model **post** `/accounts/{account_id}/ai/run/{model_name}` This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases. Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). ### Path Parameters - `account_id: string` - `model_name: string` ### Body Parameters - `body: optional object { text } or object { prompt, guidance, height, 8 more } or object { prompt, lang } or 12 more` - `TextClassification = object { text }` - `text: string` The text that you want to classify - `TextToImage = object { prompt, guidance, height, 8 more }` - `prompt: string` A text description of the image you want to generate - `guidance: optional number` Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt - `height: optional number` The height of the generated image in pixels - `image: optional array of number` For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values - `image_b64: optional string` For use with img2img tasks. A base64-encoded string of the input image - `mask: optional array of number` An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values - `negative_prompt: optional string` Text describing elements to avoid in the generated image - `num_steps: optional number` The number of diffusion steps; higher values can improve quality but take longer - `seed: optional number` Random seed for reproducibility of the image generation - `strength: optional number` A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image - `width: optional number` The width of the generated image in pixels - `TextToSpeech = object { prompt, lang }` - `prompt: string` A text description of the audio you want to generate - `lang: optional string` The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified - `TextEmbeddings = object { text }` - `text: string or array of string` The text to embed - `string` The text to embed - `array of string` Batch of text values to embed - `AutomaticSpeechRecognition = object { audio, source_lang, target_lang }` - `audio: array of number` An array of integers that represent the audio data constrained to 8-bit unsigned integer values - `source_lang: optional string` The language of the recorded audio - `target_lang: optional string` The language to translate the transcription into. Currently only English is supported. - `ImageClassification = object { image }` - `image: array of number` An array of integers that represent the image data constrained to 8-bit unsigned integer values - `ObjectDetection = object { image }` - `image: optional array of number` An array of integers that represent the image data constrained to 8-bit unsigned integer values - `Prompt = object { prompt, frequency_penalty, lora, 10 more }` - `prompt: string` The input text prompt for the model to generate a response. - `frequency_penalty: optional number` Decreases the likelihood of the model repeating the same lines verbatim. - `lora: optional string` Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. - `max_tokens: optional number` The maximum number of tokens to generate in the response. - `presence_penalty: optional number` Increases the likelihood of the model introducing new topics. - `raw: optional boolean` If true, a chat template is not applied and you must adhere to the specific model's expected formatting. - `repetition_penalty: optional number` Penalty for repeated tokens; higher values discourage repetition. - `response_format: optional object { json_schema, type }` - `json_schema: optional unknown` - `type: optional "json_object" or "json_schema"` - `"json_object"` - `"json_schema"` - `seed: optional number` Random seed for reproducibility of the generation. - `stream: optional boolean` If true, the response will be streamed back incrementally using SSE, Server Sent Events. - `temperature: optional number` Controls the randomness of the output; higher values produce more random results. - `top_k: optional number` Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. - `top_p: optional number` Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. - `TextGeneration = object { messages, frequency_penalty, functions, 11 more }` - `messages: array of object { content, role }` An array of message objects representing the conversation history. - `content: string or array of object { text, type }` The content of the message as a string. - `string` The content of the message as a string. - `array of object { text, type }` Array of text content parts. - `text: optional string` Text content - `type: optional string` Type of the content (text) - `role: string` The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). - `frequency_penalty: optional number` Decreases the likelihood of the model repeating the same lines verbatim. - `functions: optional array of object { code, name }` - `code: string` - `name: string` - `max_tokens: optional number` The maximum number of tokens to generate in the response. - `presence_penalty: optional number` Increases the likelihood of the model introducing new topics. - `raw: optional boolean` If true, a chat template is not applied and you must adhere to the specific model's expected formatting. - `repetition_penalty: optional number` Penalty for repeated tokens; higher values discourage repetition. - `response_format: optional object { json_schema, type }` - `json_schema: optional unknown` - `type: optional "json_object" or "json_schema"` - `"json_object"` - `"json_schema"` - `seed: optional number` Random seed for reproducibility of the generation. - `stream: optional boolean` If true, the response will be streamed back incrementally using SSE, Server Sent Events. - `temperature: optional number` Controls the randomness of the output; higher values produce more random results. - `tools: optional array of object { description, name, parameters } or object { function, type }` A list of tools available for the assistant to use. - `object { description, name, parameters }` - `description: string` A brief description of what the tool does. - `name: string` The name of the tool. More descriptive the better. - `parameters: object { properties, type, required }` Schema defining the parameters accepted by the tool. - `properties: map[object { description, type } ]` Definitions of each parameter. - `description: string` A description of the expected parameter. - `type: string` The data type of the parameter. - `type: string` The type of the parameters object (usually 'object'). - `required: optional array of string` List of required parameter names. - `Function = object { function, type }` - `function: object { description, name, parameters }` Details of the function tool. - `description: string` A brief description of what the function does. - `name: string` The name of the function. - `parameters: object { properties, type, required }` Schema defining the parameters accepted by the function. - `properties: map[object { description, type } ]` Definitions of each parameter. - `description: string` A description of the expected parameter. - `type: string` The data type of the parameter. - `type: string` The type of the parameters object (usually 'object'). - `required: optional array of string` List of required parameter names. - `type: string` Specifies the type of tool (e.g., 'function'). - `top_k: optional number` Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. - `top_p: optional number` Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. - `Translation = object { target_lang, text, source_lang }` - `target_lang: string` The language code to translate the text into (e.g., 'es' for Spanish) - `text: string` The text to be translated - `source_lang: optional string` The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified - `Summarization = object { input_text, max_length }` - `input_text: string` The text that you want the model to summarize - `max_length: optional number` The maximum length of the generated summary in tokens - `ImageToText = object { image, frequency_penalty, max_tokens, 8 more }` - `image: array of number` An array of integers that represent the image data constrained to 8-bit unsigned integer values - `frequency_penalty: optional number` Decreases the likelihood of the model repeating the same lines verbatim. - `max_tokens: optional number` The maximum number of tokens to generate in the response. - `presence_penalty: optional number` Increases the likelihood of the model introducing new topics. - `prompt: optional string` The input text prompt for the model to generate a response. - `raw: optional boolean` If true, a chat template is not applied and you must adhere to the specific model's expected formatting. - `repetition_penalty: optional number` Penalty for repeated tokens; higher values discourage repetition. - `seed: optional number` Random seed for reproducibility of the generation. - `temperature: optional number` Controls the randomness of the output; higher values produce more random results. - `top_k: optional number` Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. - `top_p: optional number` Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. - `object { image, prompt, frequency_penalty, 8 more }` - `image: string` Image in base64 encoded format. - `prompt: string` The input text prompt for the model to generate a response. - `frequency_penalty: optional number` Decreases the likelihood of the model repeating the same lines verbatim. - `ignore_eos: optional boolean` Whether to ignore the EOS token and continue generating tokens after the EOS token is generated. - `max_tokens: optional number` The maximum number of tokens to generate in the response. - `presence_penalty: optional number` Increases the likelihood of the model introducing new topics. - `repetition_penalty: optional number` Penalty for repeated tokens; higher values discourage repetition. - `seed: optional number` Random seed for reproducibility of the generation. - `temperature: optional number` Controls the randomness of the output; higher values produce more random results. - `top_k: optional number` Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. - `top_p: optional number` Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. - `ImageTextToText = object { image, messages, frequency_penalty, 8 more }` - `image: string` Image in base64 encoded format. - `messages: array of object { content, role }` An array of message objects representing the conversation history. - `content: string or array of object { type, image_url, text }` The content of the message as a string. - `string` The content of the message as a string. - `array of object { type, image_url, text }` Array of content parts (text, image_url, etc.). - `type: string` Type of the content part (e.g. 'text', 'image_url'). - `image_url: optional object { url }` Image URL object (when type is 'image_url'). - `url: string` Image URI with data (e.g. data:image/jpeg;base64,/9j/...). - `text: optional string` Text content (when type is 'text'). - `role: string` The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). - `frequency_penalty: optional number` Decreases the likelihood of the model repeating the same lines verbatim. - `ignore_eos: optional boolean` Whether to ignore the EOS token and continue generating tokens after the EOS token is generated. - `max_tokens: optional number` The maximum number of tokens to generate in the response. - `presence_penalty: optional number` Increases the likelihood of the model introducing new topics. - `repetition_penalty: optional number` Penalty for repeated tokens; higher values discourage repetition. - `seed: optional number` Random seed for reproducibility of the generation. - `temperature: optional number` Controls the randomness of the output; higher values produce more random results. - `top_k: optional number` Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. - `top_p: optional number` Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. - `MultimodalEmbeddings = object { image, text }` - `image: optional string` Image in base64 encoded format. - `text: optional array of string` ### Returns - `result: optional array of object { label, score } or string or object { audio } or 12 more` An array of classification results for the input text - `TextClassification = array of object { label, score }` An array of classification results for the input text - `label: optional string` The classification label assigned to the text (e.g., 'POSITIVE' or 'NEGATIVE') - `score: optional number` Confidence score indicating the likelihood that the text belongs to the specified label - `TextToImage = string` The generated image in PNG format - `Audio = object { audio }` - `audio: optional string` The generated audio in MP3 format, base64-encoded - `string` The generated audio in MP3 format - `TextEmbeddings = object { data, shape }` - `data: optional array of array of number` Embeddings of the requested text values - `shape: optional array of number` - `AutomaticSpeechRecognition = object { text, vtt, word_count, words }` - `text: string` The transcription - `vtt: optional string` - `word_count: optional number` - `words: optional array of object { end, start, word }` - `end: optional number` The ending second when the word completes - `start: optional number` The second this word begins in the recording - `word: optional string` - `ImageClassification = array of object { label, score }` - `label: optional string` The predicted category or class for the input image based on analysis - `score: optional number` A confidence value, between 0 and 1, indicating how certain the model is about the predicted label - `ObjectDetection = array of object { box, label, score }` An array of detected objects within the input image - `box: optional object { xmax, xmin, ymax, ymin }` Coordinates defining the bounding box around the detected object - `xmax: optional number` The x-coordinate of the bottom-right corner of the bounding box - `xmin: optional number` The x-coordinate of the top-left corner of the bounding box - `ymax: optional number` The y-coordinate of the bottom-right corner of the bounding box - `ymin: optional number` The y-coordinate of the top-left corner of the bounding box - `label: optional string` The class label or name of the detected object - `score: optional number` Confidence score indicating the likelihood that the detection is correct - `object { response, tool_calls, usage }` - `response: string` The generated text response from the model - `tool_calls: optional array of object { arguments, name }` An array of tool calls requests made during the response generation - `arguments: optional unknown` The arguments passed to be passed to the tool call request - `name: optional string` The name of the tool to be called - `usage: optional object { completion_tokens, prompt_tokens, total_tokens }` Usage statistics for the inference request - `completion_tokens: optional number` Total number of tokens in output - `prompt_tokens: optional number` Total number of tokens in input - `total_tokens: optional number` Total number of input and output tokens - `string` - `Translation = object { translated_text }` - `translated_text: optional string` The translated text in the target language - `Summarization = object { summary }` - `summary: optional string` The summarized version of the input text - `ImageToText = object { description }` - `description: optional string` - `ImageTextToText = object { description }` - `description: optional string` - `MultimodalEmbeddings = object { data, shape }` - `data: optional array of array of number` - `shape: optional array of number` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/run/$MODEL_NAME \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "label": "label", "score": 0 } ] } ``` ## Domain Types ### AI Run Response - `AIRunResponse = array of object { label, score } or string or object { audio } or 12 more` An array of classification results for the input text - `TextClassification = array of object { label, score }` An array of classification results for the input text - `label: optional string` The classification label assigned to the text (e.g., 'POSITIVE' or 'NEGATIVE') - `score: optional number` Confidence score indicating the likelihood that the text belongs to the specified label - `TextToImage = string` The generated image in PNG format - `Audio = object { audio }` - `audio: optional string` The generated audio in MP3 format, base64-encoded - `string` The generated audio in MP3 format - `TextEmbeddings = object { data, shape }` - `data: optional array of array of number` Embeddings of the requested text values - `shape: optional array of number` - `AutomaticSpeechRecognition = object { text, vtt, word_count, words }` - `text: string` The transcription - `vtt: optional string` - `word_count: optional number` - `words: optional array of object { end, start, word }` - `end: optional number` The ending second when the word completes - `start: optional number` The second this word begins in the recording - `word: optional string` - `ImageClassification = array of object { label, score }` - `label: optional string` The predicted category or class for the input image based on analysis - `score: optional number` A confidence value, between 0 and 1, indicating how certain the model is about the predicted label - `ObjectDetection = array of object { box, label, score }` An array of detected objects within the input image - `box: optional object { xmax, xmin, ymax, ymin }` Coordinates defining the bounding box around the detected object - `xmax: optional number` The x-coordinate of the bottom-right corner of the bounding box - `xmin: optional number` The x-coordinate of the top-left corner of the bounding box - `ymax: optional number` The y-coordinate of the bottom-right corner of the bounding box - `ymin: optional number` The y-coordinate of the top-left corner of the bounding box - `label: optional string` The class label or name of the detected object - `score: optional number` Confidence score indicating the likelihood that the detection is correct - `object { response, tool_calls, usage }` - `response: string` The generated text response from the model - `tool_calls: optional array of object { arguments, name }` An array of tool calls requests made during the response generation - `arguments: optional unknown` The arguments passed to be passed to the tool call request - `name: optional string` The name of the tool to be called - `usage: optional object { completion_tokens, prompt_tokens, total_tokens }` Usage statistics for the inference request - `completion_tokens: optional number` Total number of tokens in output - `prompt_tokens: optional number` Total number of tokens in input - `total_tokens: optional number` Total number of input and output tokens - `string` - `Translation = object { translated_text }` - `translated_text: optional string` The translated text in the target language - `Summarization = object { summary }` - `summary: optional string` The summarized version of the input text - `ImageToText = object { description }` - `description: optional string` - `ImageTextToText = object { description }` - `description: optional string` - `MultimodalEmbeddings = object { data, shape }` - `data: optional array of array of number` - `shape: optional array of number` # Finetunes ## List Finetunes **get** `/accounts/{account_id}/ai/finetunes` Lists all fine-tuning jobs created by the account, including status and metrics. ### Path Parameters - `account_id: string` ### Returns - `result: object { id, created_at, model, 3 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `description: optional string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/finetunes \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "model": "model", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "description": "description" }, "success": true } ``` ## Create a new Finetune **post** `/accounts/{account_id}/ai/finetunes` Creates a new fine-tuning job for a Workers AI model using custom training data. ### Path Parameters - `account_id: string` ### Body Parameters - `model: string` - `name: string` - `description: optional string` - `public: optional boolean` ### Returns - `result: object { id, created_at, model, 4 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `public: boolean` - `description: optional string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/finetunes \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "model": "model", "name": "name" }' ``` #### Response ```json { "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "model": "model", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "public": true, "description": "description" }, "success": true } ``` ## Domain Types ### Finetune List Response - `FinetuneListResponse = object { id, created_at, model, 3 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `description: optional string` ### Finetune Create Response - `FinetuneCreateResponse = object { id, created_at, model, 4 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `public: boolean` - `description: optional string` # Assets ## Upload a Finetune Asset **post** `/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets` Uploads training data assets for a Workers AI fine-tuning job. ### Path Parameters - `account_id: string` - `finetune_id: string` ### Returns - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/finetunes/$FINETUNE_ID/finetune-assets \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "success": true } ``` ## Domain Types ### Asset Create Response - `AssetCreateResponse = object { success }` - `success: boolean` # Public ## List Public Finetunes **get** `/accounts/{account_id}/ai/finetunes/public` Lists publicly available fine-tuned models that can be used with Workers AI. ### Path Parameters - `account_id: string` ### Query Parameters - `limit: optional number` Pagination Limit - `offset: optional number` Pagination Offset - `orderBy: optional string` Order By Column Name ### Returns - `result: array of object { id, created_at, model, 4 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `public: boolean` - `description: optional string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/finetunes/public \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "model": "model", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "public": true, "description": "description" } ], "success": true } ``` ## Domain Types ### Public List Response - `PublicListResponse = object { id, created_at, model, 4 more }` - `id: string` - `created_at: string` - `model: string` - `modified_at: string` - `name: string` - `public: boolean` - `description: optional string` # Authors ## Author Search **get** `/accounts/{account_id}/ai/authors/search` Searches Workers AI models by author or organization name. ### Path Parameters - `account_id: string` ### Returns - `errors: array of unknown` - `messages: array of string` - `result: array of unknown` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/authors/search \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ {} ], "messages": [ "string" ], "result": [ {} ], "success": true } ``` ## Domain Types ### Author List Response - `AuthorListResponse = unknown` # Tasks ## Task Search **get** `/accounts/{account_id}/ai/tasks/search` Searches Workers AI models by task type (e.g., text-generation, embeddings). ### Path Parameters - `account_id: string` ### Returns - `errors: array of unknown` - `messages: array of string` - `result: array of unknown` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/tasks/search \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ {} ], "messages": [ "string" ], "result": [ {} ], "success": true } ``` ## Domain Types ### Task List Response - `TaskListResponse = unknown` # Models ## Model Search **get** `/accounts/{account_id}/ai/models/search` Searches Workers AI models by name or description. ### Path Parameters - `account_id: string` ### Query Parameters - `author: optional string` Filter by Author - `hide_experimental: optional boolean` Filter to hide experimental models - `page: optional number` - `per_page: optional number` - `search: optional string` Search - `source: optional number` Filter by Source Id - `task: optional string` Filter by Task Name ### Returns - `errors: array of unknown` - `messages: array of string` - `result: array of unknown` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/models/search \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ {} ], "messages": [ "string" ], "result": [ {} ], "success": true } ``` ## Domain Types ### Model List Response - `ModelListResponse = unknown` # Schema ## Get Model Schema **get** `/accounts/{account_id}/ai/models/schema` Retrieves the input and output JSON schema definition for a Workers AI model. ### Path Parameters - `account_id: string` ### Query Parameters - `model: string` Model Name ### Returns - `result: object { input, output }` - `input: object { additionalProperties, description, type }` - `additionalProperties: boolean` - `description: string` - `type: string` - `output: object { additionalProperties, description, type }` - `additionalProperties: boolean` - `description: string` - `type: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/models/schema \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": { "input": { "additionalProperties": true, "description": "JSON Schema definition for the model's input parameters", "type": "object" }, "output": { "additionalProperties": true, "description": "JSON Schema definition for the model's output format", "type": "object" } }, "success": true } ``` ## Domain Types ### Schema Get Response - `SchemaGetResponse = object { input, output }` - `input: object { additionalProperties, description, type }` - `additionalProperties: boolean` - `description: string` - `type: string` - `output: object { additionalProperties, description, type }` - `additionalProperties: boolean` - `description: string` - `type: string` # To Markdown ## Convert Files into Markdown **post** `/accounts/{account_id}/ai/tomarkdown` Converts uploaded files into Markdown format using Workers AI. ### Path Parameters - `account_id: string` ### Returns - `result: array of object { data, format, mimeType, 2 more }` - `data: string` - `format: string` - `mimeType: string` - `name: string` - `tokens: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/tomarkdown \ -H 'Content-Type: multipart/form-data' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -F file='{"files":["Example data"]}' ``` #### Response ```json { "result": [ { "data": "data", "format": "format", "mimeType": "mimeType", "name": "name", "tokens": "tokens" } ], "success": true } ``` ## Get all converted formats supported **get** `/accounts/{account_id}/ai/tomarkdown/supported` Lists all file formats supported for conversion to Markdown. ### Path Parameters - `account_id: string` ### Returns - `result: array of object { extension, mimeType }` - `extension: string` - `mimeType: string` - `success: boolean` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai/tomarkdown/supported \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "result": [ { "extension": "extension", "mimeType": "mimeType" } ], "success": true } ``` ## Domain Types ### To Markdown Transform Response - `ToMarkdownTransformResponse = object { data, format, mimeType, 2 more }` - `data: string` - `format: string` - `mimeType: string` - `name: string` - `tokens: string` ### To Markdown Supported Response - `ToMarkdownSupportedResponse = object { extension, mimeType }` - `extension: string` - `mimeType: string`