# AI/ML API — MCP server on mcp.ai > Connect your AI/ML API account and use 30 tools for artificial intelligence straight from your AI agent. Connect with your own API key. AI/ML API provides a suite of AI models and solutions for various tasks, including text generation, image processing, and more. By: mcp.ai · official Page: https://mcp.ai/ai_ml_api ## Connect (MCP protocol) Remote MCP endpoint (HTTP, streamable): https://api.mcp.ai/p_ai_ml_api?ms=1787293560000 Add it as a custom/remote MCP connector, then authenticate when prompted. ## REST API (no MCP client required) Every tool is also a REST endpoint, authed with a workspace API key. Discover: GET https://api.mcp.ai/api/ai_ml_api/_endpoints # public; lists every endpoint Call: POST https://api.mcp.ai/api/ai_ml_api/ Authorization: Bearer sk_live_… # create one at https://mcp.ai/settings/api-keys Content-Type: application/json Body: { …args } → { "ok": true, "tool": "", "result": { … } } ## Developer docs How to use (MCP or REST), markdown: https://mcp.ai/ai_ml_api/skill.md Postman collection (v2.1): https://mcp.ai/ai_ml_api/postman.json ## Tools - ai_ml_api_cancel_run(run_id: string, thread_id: string) — Tool to cancel a run that is currently in progress. Use when you need to stop an assistant run before it completes. - ai_ml_api_create_assistant(name?: string, model: string, tools?: object[], top_p?: number, metadata?: object, description?: string, temperature?: number, instructions?: string, tool_resources?: object, response_format?: object|string, reasoning_effort?: string) — Tool to create an AI assistant with configurable model, instructions, and tools. Use when you need to set up a new assistant that can maintain conversation context and use tools like code_interpreter - ai_ml_api_create_message(role: string, content: string|object[], metadata?: object, thread_id: string, attachments?: object[]) — Tool to create a new message in a thread. Use when you need to add a user or assistant message to an existing conversation thread. - ai_ml_api_create_run(model?: string, tools?: object[], top_p?: number, metadata?: object, thread_id: string, temperature?: number, tool_choice?: string|object, assistant_id: string, instructions?: string, response_format?: string|object, max_prompt_tokens?: integer, additional_messages?: object[], parallel_tool_calls?: boolean, truncation_strategy?: object, max_completion_tokens?: integer) — Tool to create a run that executes an assistant on a thread. The assistant processes messages in the thread and generates responses based on its instructions and available tools. - ai_ml_api_create_thread(messages?: object[], metadata?: object, tool_resources?: object) — Tool to create a new thread for conversation with an assistant. Threads store messages and maintain context across interactions. Use when starting a new conversation or when you need a fresh context f - ai_ml_api_delete_assistant(assistant_id: string) — Tool to delete an assistant by ID. Use when you need to remove an assistant that is no longer needed. - ai_ml_api_delete_message(thread_id: string, message_id: string) — Tool to delete a specific message from a thread. Use when you need to remove an unwanted or erroneous message from a conversation thread. - ai_ml_api_delete_thread(thread_id: string) — Tool to delete a thread by its ID. Use when you need to remove an existing thread from the system. - ai_ml_api_get_assistant(assistant_id: string) — Tool to retrieve details of a specific assistant by ID. Use when you need to fetch configuration, model settings, instructions, or available tools for an existing assistant. - ai_ml_api_get_billing_balance() — Tool to retrieve the current billing balance for the account. Use when you need to check available credits, balance status, or auto-debit configuration. - ai_ml_api_get_luma_generation(ids: string) — Tool to fetch Luma AI video generation results by generation IDs. Use after creating a generation to check its status and retrieve the generated video URL when completed. - ai_ml_api_get_message(thread_id: string, message_id: string) — Tool to retrieve information about a specific message by its ID. Use when you need to fetch details of a particular message in a thread. - ai_ml_api_get_response(include?: string[], response_id: string, starting_after?: integer, include_obfuscation?: boolean) — Tool to retrieve a previously generated model response by its unique ID. Use when you need to access details of a specific response, including its output, status, and usage statistics. - ai_ml_api_get_run(run_id: string, thread_id: string) — Tool to retrieve a specific run by ID from a thread. Use when you need to check the status, results, or details of a previously created run. - ai_ml_api_get_run_step(run_id: string, step_id: string, thread_id: string) — Tool to retrieve a specific run step by its ID within a thread and run. Use when you need detailed information about a particular step's execution status and results. - ai_ml_api_get_thread(thread_id: string) — Tool to retrieve information about a specific thread by ID. Use when you need to fetch thread details, metadata, or available tool resources for an existing conversation thread. - ai_ml_api_list_assistants(after?: string, limit?: integer, order?: string, before?: string) — Tool to list all assistants associated with the account. Use when you need to retrieve available assistants with pagination support. - ai_ml_api_list_batches(batch_id: string) — Tool to get the status or results of a batch processing job. Use when you need to check the progress or retrieve results of a previously submitted batch. - ai_ml_api_list_luma_generations(limit?: integer, offset?: integer) — Tool to fetch user's Luma AI video generations. Use when you need to retrieve a list of all Luma AI video generation tasks for the authenticated user. - ai_ml_api_list_messages(after?: string, limit?: integer, order?: string, before?: string, run_id?: string, thread_id: string) — Tool to retrieve a list of messages from a specific thread. Use when you need to fetch conversation history or message content from an AI assistant thread. - ai_ml_api_list_models() — Tool to list all available AI models from the AI/ML API. Use when you need to retrieve the complete catalog of 400+ models including chat, image, video, voice, and other model types. - ai_ml_api_list_models_with_details() — Tool to list all available AI/ML models with detailed information including pricing, features, and capabilities. Use when you need to discover available models or get comprehensive model metadata. - ai_ml_api_list_run_steps(after?: string, limit?: integer, order?: string, before?: string, run_id: string, thread_id: string) — Tool to list the steps in a run. Use when you need to retrieve and examine the execution steps of a specific run within a thread. - ai_ml_api_list_runs(after?: string, limit?: integer, order?: string, before?: string, thread_id: string) — Tool to list all runs for a specific thread. Use when you need to retrieve runs with pagination support. - ai_ml_api_submit_tool_outputs(run_id: string, stream?: boolean, thread_id: string, tool_outputs: object[]) — Tool to submit tool outputs for a run that requires action. Use when a run has status 'requires_action' and needs tool call results to continue execution. - ai_ml_api_text_chat_completion(n?: integer, stop?: string[], user?: string, model: string, top_p?: number, stream?: boolean, messages: object[], logit_bias?: object, max_tokens?: integer, temperature?: number, presence_penalty?: number, frequency_penalty?: number) — Tool to generate text completions or chat responses using a specified LLM model. Use after assembling the conversation history to produce the next response. - ai_ml_api_update_assistant(name?: string, model?: string, tools?: object[], top_p?: number, metadata?: object, description?: string, temperature?: number, assistant_id: string, instructions?: string, tool_resources?: object, response_format?: object, reasoning_effort?: string) — Tool to modify an existing assistant's properties including name, instructions, model, and tools. Use when you need to update an assistant's configuration or behavior after it has been created. - ai_ml_api_update_message(metadata?: object, thread_id: string, message_id: string) — Tool to modify metadata for a specific message in a thread. Use when you need to update message metadata such as tags or custom fields. - ai_ml_api_update_run(run_id: string, metadata?: object, thread_id: string) — Tool to update a run's metadata with key-value pairs. Use when you need to attach or modify additional information for a specific run. - ai_ml_api_update_thread(metadata?: object, thread_id: string, tool_resources?: object) — Tool to update thread metadata and tool resources in the AI/ML API. Use when you need to modify existing thread properties or attach resources. ## Example prompts - "What can I do in AI/ML API?" - "Show me a summary of my AI/ML API account" ## Links Docs: https://mcp.ai/docs/mcps/ai_ml_api Website: https://mcp.ai/mcps/ai_ml_api