Responses

Submit input to a Genesis model that supports Responses, then retrieve generated text from returned output items.

POST https://token.moi.matrixorigin.cn/v1/responses

Before you call

Prepare credentials with Genesis access and select a model that supports Responses. Obtain a model ID from List models.

Request body

Replace $GENESIS_ACCESS_TOKEN with an access token or service-account API key, and $MODEL_ID with the selected model ID.

curl -X POST \
  "https://token.moi.matrixorigin.cn/v1/responses" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "'"$MODEL_ID"'",
    "input": "Explain the purpose of an index in one sentence.",
    "store": false,
    "stream": false,
    "temperature": 0.7,
    "top_p": 0.9,
    "max_output_tokens": 2048,
    "instructions": "You are a concise API debugging assistant."
  }'

Field

Type

Required

Description

model

string

Yes

Responses model ID to call.

input

string

Yes

Text input for this request.

store

boolean

No

Whether to store this Response.

stream

boolean

No

Whether to request native Responses SSE events.

temperature

number

No

Sampling temperature.

top_p

number

No

Nucleus-sampling parameter.

max_output_tokens

integer

No

Maximum output tokens.

instructions

string

No

Additional instructions for this request.

Successful response

The service returns the Response ID, status, and output items.

{
  "id": "<RESPONSE_ID>",
  "object": "response",
  "status": "completed",
  "model": "<MODEL_ID>",
  "output": [{"type":"message","role":"assistant","content":[{"type":"output_text","text":"An index uses a data structure for fast lookup and reduces the amount of data scanned by a query."}]}]
}

Field

Type

Description

id

string

Identifier for this Response.

object

string

Response object type; the example is response.

status

string

Current response status.

model

string

Model ID that processed the request.

output

array of object

Output items returned for the request.

The following table expands each item in the example output array.

Field

Type

Description

type

string

Output item type; the example is message.

role

string

Message role; the example is assistant.

content

array of object

Content items in this message.

The following table expands each item in the example output[].content array.

Field

Type

Description

type

string

Content type; the example is output_text.

text

string

Generated text when the content type is output_text.

Error response

{"error":{"message":"<human-readable error message>","type":"<error type; may be omitted>","code":"<error code; may be omitted>"}}

Field

Type

Description

error

object

Error object.

Field

Type

Description

message

string

Human-readable error message.

type

string

Error category returned by the model service; it may be omitted.

code

string or null

Error code returned by the model service; it may be omitted.

Last updated on