# Call the API

After completing this page, you will list the models available to your credentials and receive a text response through Chat Completions. For the full list of endpoints and request details, see [Genesis](../../api/genesis/index.md).

(sdk-genesis-http-prepare)=
## Prepare connection details

Prepare the complete Genesis API base URL supplied by the current environment, and either a personal access token or service-account API key with Genesis access:

```bash
export GENESIS_BASE_URL='<Complete Genesis Base URL copied from the console>'
export GENESIS_ACCESS_TOKEN='<your-access-token>'
```

The base URL usually already includes the version path. Keep the value supplied by the current environment unchanged; do not append another version path or substitute another product's service address.

(sdk-genesis-http-model)=
## Get a model ID

```bash
curl "$GENESIS_BASE_URL/models" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

Select a model that supports text conversation from the response, and save its ID:

```bash
export MODEL_ID='<model-id-from-response>'
```

(sdk-genesis-http-call)=
## Send a message

```bash
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
  }'
```

Text content in the response confirms that the model returned a response. Save the request ID and actual model ID from the response to help investigate later calls.

(sdk-genesis-http-next)=
## Next steps

- See all available models: [List models](../../../reference/api/genesis/models.md)
- Integrate with an SDK in your application: see [Genesis SDK](../../sdk/genesis-compatible/index.md)
