Call a Genesis model¶
After completing this page, you will list the models available to your credential and receive a text response through Chat Completions.
1. Prepare connection information¶
Copy the complete base URL from the Use page in the Genesis console for the current environment. Prepare a personal access token or a service-account API key authorized for Genesis:
export GENESIS_BASE_URL='<Complete Genesis Base URL copied from the console>'
export GENESIS_ACCESS_TOKEN='<your-access-token>'
The base URL commonly already includes the version path. Keep the copied value unchanged: do not append /v1 again, and do not use the console web URL or a Product API base URL.
2. Get a model ID¶
curl "$GENESIS_BASE_URL/models" \
-H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
-H "Accept: application/json"
Choose a model that supports text chat from data[].id in the response and save its ID:
export MODEL_ID='<model-id-from-response>'
3. Send a message¶
curl -X POST "$GENESIS_BASE_URL/chat/completions" \
-H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$MODEL_ID"'",
"messages": [
{"role": "user", "content": "Explain data lineage in one sentence."}
],
"max_tokens": 1024
}'
The presence of choices[0].message.content in the response indicates that a model response was received. Save the request ID and actual model ID from the response for later troubleshooting.