For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
DocsReferenceChangelog
DocsReferenceChangelog
  • 2025
    • August
    • May
    • April
    • March
    • February
    • January
  • 2024
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2023
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
LogoLogo
Sign inBook a demo
On this page
  • TypeScript SDK
2023

April

Was this page helpful?
Previous

March

Next
Built with

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

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

Installation

$npm i humanloop

Example usage

1import { Humanloop } from "humanloop"
2
3const humanloop = new Humanloop({
4 // Defining the base path is optional and defaults to https://api.humanloop.com/v3
5 // basePath: "https://api.humanloop.com/v3",
6 apiKey: 'API_KEY',
7})
8
9
10const chatResponse = await humanloop.chat({
11 "project": "project_example",
12 "messages": [
13 {
14 "role": "user",
15 "content": "Write me a song",
16 }
17 ],
18 "provider_api_keys": {
19 "openai": OPENAI_API_KEY
20 },
21 "model_config": {
22 "model": "gpt-4",
23 "temperature": 1,
24 },
25})
26
27console.log(chatResponse)