open-index/open-npm huggingface dataset:
npm package: @leap-ai/sdk
Description: Client for Leap
Author: Konfig
Latest version: 1.1.4

# @leap-ai/sdk

[![npm](https://img.shields.io/badge/npm-v1.1.4-blue)](https://www.npmjs.com/package/@leap-ai/sdk/v/1.1.4)
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://tryleap.ai/)

The Official Leap API
## Installing

### npm
```
npm install @leap-ai/sdk --save
```

### yarn
```
yarn add @leap-ai/sdk
```

**Important note: this library can be used in both the client-side or server-side, but using it
in client-side browser code is not recommended as you would expose security credentials.**



## Getting Started

```typescript
import { Leap } from "@leap-ai/sdk";

const leap = new Leap({
  // Defining the base path is optional and defaults to https://api.tryleap.ai
  // basePath: "https://api.tryleap.ai",
  accessToken: "ACCESS_TOKEN",
});

const generateResponse = await leap.images.generate({
  modelId: "modelId_example",
  prompt: "A photo of an astronaut riding a horse",
  negativePrompt: "asymmetric, bad hands, bad hair",
  steps: 50,
  width: 1024,
  height: 1024,
  numberOfImages: 1,
  promptStrength: 7,
  seed: 4523184,
});

console.log(generateResponse);
```

## Documentation for API Endpoints

All URIs are relative to *https://api.tryleap.ai*

Tag | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Images* | [**generate**](docs/ImagesApi.md#generate) | **POST** /api/v1/images/models/{modelId}/inferences | Generate an Image
*Images* | [**delete**](docs/ImagesApi.md#delete) | **DELETE** /api/v1/images/models/{modelId}/inferences/{inferenceId} | Delete Image Job
*Images* | [**findOne**](docs/ImagesApi.md#findOne) | **GET** /api/v1/images/models/{modelId}/inferences/{inferenceId} | Get Single Image Job
*Images* | [**listAll**](docs/ImagesApi.md#listAll) | **GET** /api/v1/images/models/{modelId}/inferences | List All Image Jobs
*Image Models* | [**deleteModel**](docs/ImageModelsApi.md#deleteModel) | **DELETE** /api/v2/images/models/{modelId} | Delete a Model
*Image Models* | [**getModel**](docs/ImageModelsApi.md#getModel) | **GET** /api/v2/images/models/{modelId} | Get a Single Model
*Image Models* | [**listAllModels**](docs/ImageModelsApi.md#listAllModels) | **GET** /api/v2/images/models | List All Models
*Image Models* | [**trainModel**](docs/ImageModelsApi.md#trainModel) | **POST** /api/v2/images/models/new | Train Model
*Music* | [**findOne**](docs/MusicApi.md#findOne) | **GET** /api/v1/music/{inferenceId} | Get a Music Generation Job
*Music* | [**generate**](docs/MusicApi.md#generate) | **POST** /api/v1/music | Generate Music
*Music* | [**listAll**](docs/MusicApi.md#listAll) | **GET** /api/v1/music | List Music Generation Jobs

## Author
This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)