> This page is for version v5.0 (default).
> For other versions, use one of these documentation indexes:
> - v5.0 (default): https://humanloop.com/docs/v5/llms.txt
> - v4.0: https://humanloop.com/docs/v4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

# April

## TypeScript SDK

*April 3rd, 2023*

We now have a fully typed TypeScript SDK to make working with Humanloop even easier.

[https://www.npmjs.com/package/humanloop](https://www.npmjs.com/package/humanloop)

You can use this with your JavaScript, TypeScript or Node projects.

**Installation**

```shell
npm i humanloop
```

**Example usage**

```typescript
import { Humanloop } from "humanloop"

const humanloop = new Humanloop({
  // Defining the base path is optional and defaults to https://api.humanloop.com/v3
  // basePath: "https://api.humanloop.com/v3",
  apiKey: 'API_KEY',
})


const chatResponse = await humanloop.chat({
  "project": "project_example",
  "messages": [
    {
      "role": "user",
      "content": "Write me a song",
    }
  ],
  "provider_api_keys": {
    "openai": OPENAI_API_KEY
  },
  "model_config": {
    "model": "gpt-4",
    "temperature": 1,
  },
})

console.log(chatResponse)
```