Responses API

POST /v1/responses is used by Codex CLI and the OpenAI Responses SDK. Requests and replies are passed to the provider as is, statelessly.

Request

Body
{
  "model": "MODEL_ID",
  "input": [{"role": "user", "content": "..."}],
  "max_output_tokens": 500,
  "store": false
}
FieldRequiredNotes
modelyesAn ID from GET /v1/models.
inputyesText, or an array of input items (1 to 5,000 items).
max_output_tokensnoOutput token limit. When empty, the model limit is used. Above the model limit is rejected with 400 invalid_request.
streamnotrue for Responses SSE (response.created, response.output_text.delta, response.completed, and others).
storenoWhen left out, forced to false (nothing stored at the provider).
othersnoPassed through as is. Support depends on the model.

Examples

curl https://api.markas.ai.id/v1/responses \
  -H "Authorization: Bearer $MARKASAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "input": "What is an API?",
    "max_output_tokens": 300
  }'
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.markas.ai.id/v1", api_key=os.environ["MARKASAI_API_KEY"])

resp = client.responses.create(model="MODEL_ID", input="What is an API?", max_output_tokens=300)
print(resp.output_text)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.markas.ai.id/v1", apiKey: process.env.MARKASAI_API_KEY });

const resp = await client.responses.create({ model: "MODEL_ID", input: "What is an API?", max_output_tokens: 300 });
console.log(resp.output_text);

Billing

  • Billing uses the Responses usage (input_tokens, output_tokens, input_tokens_details.cached_tokens) from a regular response or the response.completed event when streaming.
  • If the provider reports no usage, billing uses a conservative estimate, marked as an estimate in the dashboard.

Limitations

Because it is stateless, GET /v1/responses/{id}, POST /v1/responses/{id}/cancel, and previous_response_id are not available. Send the conversation history again in input.