> ## 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.

# OpenAI compatibility

> Use the OpenAI TypeScript SDK with supported MKA1 endpoints.

Use the OpenAI SDK for operations that MKA1 exposes with a compatible request and response contract. Use the MKA1 SDK for MKA1-specific resources such as saved agents, Compute, repositories, and resource permissions.

The **OpenAI SDK** tabs in these guides use the OpenAI TypeScript client. They authenticate with an MKA1 API key, not an OpenAI key.

## Install the client

```bash theme={null}
npm install openai
```

## Send a response request

```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/',
});

const response = await openai.responses.create({
  model: 'auto',
  input: 'Explain what MKA1 does in one sentence.',
});
console.log(response.output_text);
```

For a private deployment, replace the host with your deployment’s API gateway and retain the `/api/v1/llm/` path. Use a model ID available in your organization; `auto` resolves through its configured model registry and routing policy.

## Choose the matching example

Guides for [Responses](/docs/generate-a-response), [Conversations](/docs/conversations), [Files](/docs/files), and [Vector stores](/docs/vector-stores) include OpenAI SDK examples for supported operations.

Compatibility is operation-specific. An OpenAI method’s existence does not mean MKA1 implements every OpenAI feature or parameter. In particular, MKA1 eval suites, saved agents, and Compute jobs have their own APIs.

## Identify an application user

For a server-side integration, attach the end-user header when configuring your client or on the relevant request:

```ts OpenAI SDK theme={null}
const userResponse = await openai.responses.create({
  model: 'auto',
  input: 'Summarize this support request.',
}, {
  headers: { 'X-On-Behalf-Of': '<end-user-id>' },
});
console.log(userResponse.output_text);
```

See [End-user identity](/docs/end-user-identity) for scoping and [API reference](/api-reference/introduction) for the exact MKA1 contract.
