Mume AIMume AI
DocsModelsPricingChat
OverviewChat CompletionsResponses APIStreamingFunction CallingWeb SearchMCP ServersModelsError HandlingAuthentication

Responses API

The Responses API offers a streamlined interface for single-turn interactions — perfect for quick queries and simple use cases. It supports both structured message input and simple string input.

Endpoint

Endpoint
POST https://mume.ai/api/v1/responses

Structured Input

Python

Python
import openai client = openai.OpenAI( api_key="your-api-key", base_url="https://mume.ai/api/v1", ) response = client.responses.create( model="openai/gpt-4.1-nano", input=[ {"type": "message", "content": "Write a poem about the moon.", "role": "user"} ], ) print(response.output_text.strip())

JavaScript

JavaScript
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "your-api-key", baseURL: "https://mume.ai/api/v1", }); const response = await client.responses.create({ model: "openai/gpt-4.1-nano", input: [ {type: "message", content: "Write a poem about the moon.", role: "user"}, ], }); console.log(response.output_text.trim());

cURL

Bash
curl https://mume.ai/api/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $MUME_API_KEY" \ -d '{ "model": "openai/gpt-4.1-nano", "input": [ {"type": "message", "content": "Write a poem about the moon.", "role": "user"} ] }'

Simple String Input

For the simplest use cases, just pass a string directly:

Python

Python
response = client.responses.create( model="openai/gpt-4.1-mini", input="Write a poem about the moon.", ) print(response.output_text)

JavaScript

JavaScript
const response = await client.responses.create({ model: "openai/gpt-4.1-mini", input: "Write a poem about the moon.", }); console.log(response.output_text);

Streaming Responses

Stream responses token-by-token by setting stream: true.

Python

Python
response = client.responses.create( model="openai/gpt-4.1-nano", input=[ {"type": "message", "content": "Write a poem about the moon.", "role": "user"} ], stream=True, ) for chunk in response: if chunk.type == "response.output_text.delta": print(chunk.delta, end="", flush=True)

JavaScript

JavaScript
const stream = await client.responses.create({ model: "openai/gpt-4.1-nano", input: [ {type: "message", content: "Write a poem about the moon.", role: "user"}, ], stream: true, }); for await (const chunk of stream) { if (chunk.type === "response.output_text.delta") { process.stdout.write(chunk.delta); } }

Async Streaming (Python)

Python
import openai import asyncio async_client = openai.AsyncOpenAI( api_key="your-api-key", base_url="https://mume.ai/api/v1", ) async def main(): async with async_client.responses.stream( model="openai/gpt-4.1-mini", input="Write a poem about the moon.", ) as stream: async for chunk in stream: if chunk.type == "response.output_text.delta": print(chunk.delta, end="", flush=True) asyncio.run(main())

← Chat CompletionsNext: Streaming →