@deeprelay/sdk
v0.2.1
Published
TypeScript SDK for the deeprelay Public Developer API
Readme
@deeprelay/[email protected]
A TypeScript SDK client for the api.deeprelay.ai API.
Usage
First, install the SDK from npm.
npm install @deeprelay/sdk --saveNext, try it out.
import {
Configuration,
BillingApi,
} from '@deeprelay/sdk';
import type { CreateCryptoDepositOperationRequest } from '@deeprelay/sdk';
async function example() {
console.log("🚀 Testing @deeprelay/sdk SDK...");
const config = new Configuration({
// Configure HTTP bearer authorization: bearerAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new BillingApi(config);
const body = {
// CreateCryptoDepositRequest
createCryptoDepositRequest: ...,
} satisfies CreateCryptoDepositOperationRequest;
try {
const data = await api.createCryptoDeposit(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);Documentation
API Endpoints
All URIs are relative to https://api.deeprelay.ai/v1
| Class | Method | HTTP request | Description | ----- | ------ | ------------ | ------------- BillingApi | createCryptoDeposit | POST /billing/deposits/crypto | Create a stablecoin deposit BillingApi | createSubscriptionCheckout | POST /billing/subscription/checkout | Start a subscription checkout session BillingApi | createSubscriptionPortal | POST /billing/subscription/portal | Open the billing portal to cancel or manage the subscription BillingApi | deleteSpendingLimit | DELETE /billing/spending-limit | Clear the org spending limit BillingApi | getBalance | GET /billing/balance | Get the org credit balance BillingApi | getDeposit | GET /billing/deposits/{id} | Get one stablecoin deposit BillingApi | getReferral | GET /referrals | Get the org referral code, invite link, terms and stats BillingApi | getSpendingLimit | GET /billing/spending-limit | Get the org spending limit BillingApi | getSubscription | GET /billing/subscription | Get the org subscription status and quota usage BillingApi | listDeposits | GET /billing/deposits | List stablecoin deposits BillingApi | updateSpendingLimit | PUT /billing/spending-limit | Set the org spending limit InferenceApi | cancelVideo | POST /videos/{id}/cancel | Cancel a video generation job InferenceApi | createChatCompletion | POST /chat/completions | Create a chat completion (OpenAI-compatible) InferenceApi | createEmbeddings | POST /embeddings | Create embeddings (OpenAI-compatible) InferenceApi | createImage | POST /images/generations | Create image (OpenAI-compatible) InferenceApi | createVideo | POST /videos | Create a video generation job (async) InferenceApi | getModel | GET /models/{id} | Get a specific model (OpenAI-compatible) InferenceApi | getVideo | GET /videos/{id} | Get a video generation job InferenceApi | getVideoContent | GET /videos/{id}/content | Download a completed video artifact InferenceApi | inferencePreflight | GET /inference/preflight | Check whether a model request would be served, and at whose expense InferenceApi | listModels | GET /models | List available models (OpenAI-compatible) InferenceApi | listVideos | GET /videos | List video generation jobs MetaApi | getHealth | GET /health | Liveness probe MetaApi | getOpenApiSpec | GET /openapi.json | OpenAPI 3.1 specification UsageApi | listUsage | GET /usage | Time-bucketed usage WebhooksApi | createWebhookEndpoint | POST /webhook-endpoints | Create a webhook endpoint WebhooksApi | deleteWebhookEndpoint | DELETE /webhook-endpoints/{id} | Delete a webhook endpoint WebhooksApi | getWebhookEndpoint | GET /webhook-endpoints/{id} | Get a webhook endpoint WebhooksApi | listWebhookEndpoints | GET /webhook-endpoints | List webhook endpoints
Models
- Balance
- ChatChoice
- ChatCompletionRequest
- ChatCompletionResponse
- ChatMessage
- CreateCryptoDepositRequest
- CreateWebhookEndpointRequest
- CryptoDeposit
- Embedding
- EmbeddingsRequest
- EmbeddingsRequestInput
- EmbeddingsResponse
- EmbeddingsUsage
- GetHealth200Response
- ImagesGenerationsRequest
- ImagesResponse
- ImagesResponseDataInner
- ImagesResponseUsage
- InferencePreflight
- ListDeposits200Response
- Model
- ModelList
- ModelParametersInner
- ModelPricing
- ModelRate
- OpenAIErrorEnvelope
- OpenAIErrorEnvelopeError
- PeakWindow
- Problem
- RefereeStatus
- Referral
- SpendingLimit
- StreamOptions
- Subscription
- SubscriptionCheckoutRequest
- SubscriptionCheckoutSession
- SubscriptionPlan
- SubscriptionPortalRequest
- SubscriptionPortalSession
- SubscriptionPrice
- SubscriptionQuota
- SubscriptionUsage
- UpdateSpendingLimitRequest
- Usage
- UsageBucket
- UsagePage
- VideoCreateRequest
- VideoJob
- VideoList
- WebhookEndpoint
- WebhookEndpointPage
Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: HTTP Bearer Token authentication (deeprelay_live_<24-base62>)
About
This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:
- API version:
1.0.0 - Package version:
0.2.1 - Generator version:
7.24.0 - Build package:
org.openapitools.codegen.languages.TypeScriptFetchClientCodegen
The generated npm module supports the following:
- Environments
- Node.js
- Webpack
- Browserify
- Language levels
- ES5 - you must have a Promises/A+ library installed
- ES6
- Module systems
- CommonJS
- ES6 module system
Development
Building
To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:
npm install
npm run buildPublishing
Once you've built the package, you can publish it to npm:
npm publish