@deeprelay/sdk

中文文档
0.4.12发布于 2026/11/12Apache-2.0TypeScriptESM + CJS零依赖近 30 天下载 2169

TypeScript SDK for the deeprelay Public Developer API

原始使用文档
文档目录10 节
  1. Usage
  2. Documentation
  3. API Endpoints
  4. Models
  5. Authorization
  6. About
  7. Development
  8. Building
  9. Publishing
  10. License

@deeprelay/[email protected]

A TypeScript SDK client for the api.deeprelay.ai API.

Usage

First, install the SDK from npm.

npm install @deeprelay/sdk --save

Next, try it out.

import {
  Configuration,
  AlertsApi,
} from '@deeprelay/sdk';
import type { GetAlertSettingsRequest } 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 AlertsApi(config);

  try {
    const data = await api.getAlertSettings();
    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

ClassMethodHTTP requestDescription
AlertsApigetAlertSettingsGET /alerts/settingsGet the organization's alert settings
AlertsApiputAlertSettingsPUT /alerts/settingsReplace the organization's alert settings
ApiKeysApicreateApiKeyPOST /api-keysCreate an API key
ApiKeysApigetApiKeyGET /api-keys/{id}Get an API key
ApiKeysApilistApiKeysGET /api-keysList API keys
ApiKeysApirevokeApiKeyDELETE /api-keys/{id}Revoke an API key
ApiKeysApiupdateApiKeyPATCH /api-keys/{id}Update an API key's name or limits
BillingApicreateCryptoDepositPOST /billing/deposits/cryptoCreate a stablecoin deposit
BillingApicreateSubscriptionCheckoutPOST /billing/subscription/checkoutStart a subscription checkout session
BillingApicreateSubscriptionPortalPOST /billing/subscription/portalOpen the billing portal to cancel or manage the subscription
BillingApideleteSpendingLimitDELETE /billing/spending-limitClear the org spending limit
BillingApigetBalanceGET /billing/balanceGet the org credit balance
BillingApigetDepositGET /billing/deposits/{id}Get one stablecoin deposit
BillingApigetReferralGET /referralsGet the org referral code, invite link, terms and stats
BillingApigetSpendingLimitGET /billing/spending-limitGet the org spending limit
BillingApigetSubscriptionGET /billing/subscriptionGet the org subscription status and quota usage
BillingApilistDepositsGET /billing/depositsList stablecoin deposits
BillingApipayPlanFromBalancePOST /billing/subscription/pay-from-balancePay for a plan from deposited balance
BillingApisetRenewFromBalancePUT /billing/subscription/renew-from-balanceChoose whether the plan renews from balance
BillingApiupdateSpendingLimitPUT /billing/spending-limitSet the org spending limit
BillingApiupgradeSubscriptionPOST /billing/subscription/upgradeUpgrade the subscription to a bigger plan
InferenceApicancelVideoPOST /videos/{id}/cancelCancel a video generation job
InferenceApicreateChatCompletionPOST /chat/completionsCreate a chat completion (OpenAI-compatible)
InferenceApicreateEmbeddingsPOST /embeddingsCreate embeddings (OpenAI-compatible)
InferenceApicreateImagePOST /images/generationsCreate image (OpenAI-compatible)
InferenceApicreateVideoPOST /videosCreate a video generation job (async)
InferenceApigetModelGET /models/{id}Get a specific model (OpenAI-compatible)
InferenceApigetVideoGET /videos/{id}Get a video generation job
InferenceApigetVideoContentGET /videos/{id}/contentDownload a completed video artifact
InferenceApiinferencePreflightGET /inference/preflightCheck whether a model request would be served, and at whose expense
InferenceApilistModelsGET /modelsList available models (OpenAI-compatible)
InferenceApilistVideosGET /videosList video generation jobs
MetaApigetHealthGET /healthLiveness probe
MetaApigetOpenApiSpecGET /openapi.jsonOpenAPI 3.1 specification
RequestsApiexportRequestsGET /requests/exportExport the request log as CSV
RequestsApigetRequestGET /requests/{id}Get one request
RequestsApilistRequestsGET /requestsList requests (the request log)
UsageApilistUsageGET /usageTime-bucketed usage
WebhooksApicreateWebhookEndpointPOST /webhook-endpointsCreate a webhook endpoint
WebhooksApideleteWebhookEndpointDELETE /webhook-endpoints/{id}Delete a webhook endpoint
WebhooksApigetWebhookEndpointGET /webhook-endpoints/{id}Get a webhook endpoint
WebhooksApilistWebhookEndpointsGET /webhook-endpointsList webhook endpoints

Models

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.4.12
  • 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 build

Publishing

Once you've built the package, you can publish it to npm:

npm publish

License

Apache-2.0

版本与发布记录

@deeprelay/sdk 共发布 20 个版本,首次发布于 2026/09/22;过去 12 个月发布了 20 个版本。

版本发布日期距今
0.4.12latest2026/11/121 天前
0.4.112026/11/121 天前
0.4.102026/11/067 天前
0.4.92026/11/058 天前
0.4.82026/11/049 天前
0.4.72026/10/2717 天前

关于 @deeprelay/sdk 的常见问题

@deeprelay/sdk 是什么?

TypeScript SDK for the deeprelay Public Developer API

如何安装 @deeprelay/sdk?

在项目目录运行 npm install @deeprelay/sdk,或使用 pnpm add / yarn add / bun add。

@deeprelay/sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@deeprelay/sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@deeprelay/sdk 可以商用吗?

@deeprelay/sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@deeprelay/sdk 的下载量有多少?

根据 npm 官方下载统计,@deeprelay/sdk 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,169 次,日均约 72 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@deeprelay/sdk 还在维护吗?

最新版本 0.4.12 发布于 2026/11/12(1 天前);至今共发布 20 个版本,其中过去 12 个月发布了 20 个;首次发布于 2026/09/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。