> For the complete documentation index, see [llms.txt](https://docs.vysp.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vysp.ai/typescript-js-client/documentation-for-typescript-client-library-functions-and-classes.md).

# Documentation for TypeScript Client Library Functions and Classes

## Class: VYSPClient

### Constructor

#### `constructor( tenantApiKey: String, gateApiKey: String, installationType: String = 'cloud', installationUrl: String | null = null )`

Creates an instance of VYSPClient.

* **tenantApiKey** (string): API key for the tenant.
* **gateApiKey** (string): API key for the gate.
* **installationType** (string, optional): Specifies the type of installation. Defaults to "cloud".
* **installationUrl** (string, optional): Base URL to use if not using the cloud.

### Methods

#### `async checkInput(clientRefUserId: String, prompt: String, clientRefInternal: Boolean = false, metadata: Record<string, any> = {})`

Sends a request to perform an input check.

* **clientRefUserId** (string): Identifier for the user within logs.  This is only for logging purposes.
* **prompt** (string): Input data to be scanned.
* **clientRefInternal** (boolean, optional): Whether the user is an internal user or an external user. This is only for logging purposes.
* **metadata** (object, optional): Additional metadata related to the input. This is only for logging purposes.

#### `async checkOutput(clientRefUserId: String, prompt: String, modelOutput: String, clientRefInternal: Boolean = false, metadata: Record<string, any> = {})`

Sends a request to perform an output check.

* **clientRefUserId** (string): Identifier for the user  within logs.  This is only for logging purposes.
* **prompt** (string): Input data that was scanned in the `checkInput` function.
* **modelOutput** (string): Model output data to be scanned.
* **clientRefInternal** (boolean, optional): Whether the user is an internal user or an external user. This is only for logging purposes.
* **metadata** (object, optional): Additional metadata related to the output. This is only for logging purposes.

## Exceptions

### `AuthenticationError`

Thrown when authentication with the API fails.

### `NotFoundError`

Thrown when the requested resource cannot be found.

### `BadRequestError`

Thrown when the request is not properly formed.

### `ApiError`

General error for API issues.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vysp.ai/typescript-js-client/documentation-for-typescript-client-library-functions-and-classes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
