> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# End-user identity

> Attribute server-side requests to your application’s end users.

Use a stable ID from your application to distinguish end users behind a server-side API key. Keep the key on your server.

## Send `X-On-Behalf-Of` for an end user

Use `X-On-Behalf-Of` when your server is making a request for one of your end users.
Set the header value to your own stable end user identifier.

```http theme={null}
X-On-Behalf-Of: <end-user-id>
```

For example, if your app stores users as `user_123`, use that value consistently in requests made for that user.

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  import { SDK } from '@meetkai/mka1';

  const sdk = new SDK({ bearerAuth: 'Bearer <mka1-api-key>' });

  const response = await sdk.llm.responses.create({
    xOnBehalfOf: 'user_123',
    responsesCreateRequest: {
      model: 'auto',
      input: 'Summarize this support ticket.',
    },
  })
  ```

  ```ts OpenAI SDK theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    apiKey: '<mka1-api-key>',
    baseURL: 'https://apigw.mka1.com/api/v1/llm/',
    defaultHeaders: { 'X-On-Behalf-Of': 'user_123' },
  });

  const response = await openai.responses.create({
    model: 'auto',
    input: 'Summarize this support ticket.',
  })
  ```

  ```python Python SDK theme={null}
  from meetkai_mka1 import SDK

  sdk = SDK(bearer_auth="Bearer <mka1-api-key>")

  res = sdk.llm.responses.create(
      model="auto",
      input="Summarize this support ticket.",
      http_headers={"X-On-Behalf-Of": "user_123"},
  )
  ```

  ```csharp C# SDK theme={null}
  using MeetKai.MKA1;
  using MeetKai.MKA1.Types.Components;
  using MeetKai.MKA1.Types.Requests;

  var sdk = new SDK(bearerAuth: "Bearer <mka1-api-key>");

  var res = await sdk.Llm.Responses.CreateAsync(new ResponsesCreateRequest()
  {
      Model = "auto",
      Input = ResponsesCreateRequestInput.CreateStr("Summarize this support ticket."),
  }, xOnBehalfOf: "user_123");
  ```

  ```bash CLI theme={null}
  mka1 llm responses create --model auto --input '"Summarize this support ticket."' \
    -H 'X-On-Behalf-Of: user_123'
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/llm/responses \
    --request POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <mka1-api-key>' \
    --header 'X-On-Behalf-Of: user_123' \
    --data '{
      "model": "auto",
      "input": "Summarize this support ticket."
    }'
  ```
</CodeGroup>

If your integration does not act for a specific end user, omit `X-On-Behalf-Of`.

## Choose the right pattern

Use only `Authorization` when:

* You are calling the MKA1 API for your own backend workflow.
* The request is not tied to a specific end user.

Use both `Authorization` and `X-On-Behalf-Of` when:

* Your server is acting for one of your end users.
* You want requests, responses, files, or usage to stay associated with that end user.

Do not send an email address or mutable display name unless that is already your stable end user identifier.
Use an ID from your own system that does not change.

## Related guides

* [Short-lived tokens](/docs/short-lived-tokens)
* [Tenant isolation](/docs/authentication-deep-dive)
* [Resource permissions](/docs/authorization)
