@deeprelay/sdk
v0.4.19
Published
TypeScript SDK for the deeprelay Public Developer API
Downloads
2,880
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,
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
| Class | Method | HTTP request | Description | ----- | ------ | ------------ | ------------- AlertsApi | getAlertSettings | GET /alerts/settings | Get the organization's alert settings AlertsApi | putAlertSettings | PUT /alerts/settings | Replace the organization's alert settings ApiKeysApi | createApiKey | POST /api-keys | Create an API key ApiKeysApi | getApiKey | GET /api-keys/{id} | Get an API key ApiKeysApi | listApiKeys | GET /api-keys | List API keys ApiKeysApi | revokeApiKey | DELETE /api-keys/{id} | Revoke an API key ApiKeysApi | updateApiKey | PATCH /api-keys/{id} | Update an API key's name or limits BatchApi | cancelBatch | POST /batches/{id}/cancel | Cancel a batch (OpenAI-compatible) BatchApi | createBatch | POST /batches | Create an off-peak batch (OpenAI-compatible) BatchApi | createFile | POST /files | Upload a batch input file (OpenAI-compatible) BatchApi | deleteFile | DELETE /files/{id} | Delete a batch file (OpenAI-compatible) BatchApi | getBatchLimits | GET /batches/limits | Per-organization batch limits with current values BatchApi | listBatches | GET /batches | List batches, newest first (OpenAI-compatible) BatchApi | listFiles | GET /files | List batch files (OpenAI-compatible) BatchApi | retrieveBatch | GET /batches/{id} | Retrieve a batch (OpenAI-compatible) BatchApi | retrieveFile | GET /files/{id} | Retrieve a batch file (OpenAI-compatible) BatchApi | retrieveFileContent | GET /files/{id}/content | Download a batch file's content (JSONL) 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 | payPlanFromBalance | POST /billing/subscription/pay-from-balance | Pay for a plan from deposited balance BillingApi | setRenewFromBalance | PUT /billing/subscription/renew-from-balance | Choose whether the plan renews from balance BillingApi | updateSpendingLimit | PUT /billing/spending-limit | Set the org spending limit BillingApi | upgradeSubscription | POST /billing/subscription/upgrade | Upgrade the subscription to a bigger plan 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 RequestsApi | exportRequests | GET /requests/export | Export the request log as CSV RequestsApi | getRequest | GET /requests/{id} | Get one request RequestsApi | listRequests | GET /requests | List requests (the request log) 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
- AlertEmailToggles
- AlertSettings
- AlertSettingsUpdate
- ApiKey
- ApiKeyCreate
- ApiKeyCreated
- ApiKeyFallbackEntry
- ApiKeyList
- ApiKeyScopes
- ApiKeyUpdate
- Balance
- Batch
- BatchDeeprelay
- BatchDeeprelayBatchPrice
- BatchDeeprelayCurrentWindow
- BatchDeeprelayEstimatedTokens
- BatchDeeprelayRequestCounts
- BatchFile
- BatchFileDeleted
- BatchFileList
- BatchLimits
- BatchList
- BatchMoney
- BatchRequestCounts
- BatchUsage
- BatchUsageInputTokensDetails
- BatchUsageOutputTokensDetails
- ChatChoice
- ChatCompletionRequest
- ChatCompletionRequestResponseFormat
- ChatCompletionRequestToolChoice
- ChatCompletionResponse
- ChatMessage
- CostDetails
- CreateBatchRequest
- CreateBatchRequestOutputExpiresAfter
- CreateCryptoDepositRequest
- CreateFileRequestExpiresAfter
- CreateWebhookEndpointRequest
- CryptoDeposit
- Embedding
- EmbeddingsRequest
- EmbeddingsRequestInput
- EmbeddingsResponse
- EmbeddingsUsage
- GetHealth200Response
- ImagesGenerationsRequest
- ImagesResponse
- ImagesResponseDataInner
- ImagesResponseUsage
- InferencePreflight
- JSONSchemaFormat
- ListDeposits200Response
- Model
- ModelBatchPricing
- ModelList
- ModelMetrics
- ModelParametersInner
- ModelPricing
- ModelRate
- OpenAIErrorEnvelope
- OpenAIErrorEnvelopeError
- PayFromBalanceRequest
- PeakWindow
- Problem
- RefereeStatus
- Referral
- RenewFromBalanceRequest
- RequestAttempt
- RequestLogEntry
- RequestLogPage
- ResponseFormatJSONObject
- ResponseFormatJSONSchema
- ResponseFormatText
- SpendingLimit
- StreamOptions
- Subscription
- SubscriptionBalancePayment
- SubscriptionCheckoutRequest
- SubscriptionCheckoutSession
- SubscriptionModelUsage
- SubscriptionPaygEstimate
- SubscriptionPlan
- SubscriptionPortalRequest
- SubscriptionPortalSession
- SubscriptionPrice
- SubscriptionQuota
- SubscriptionTier
- SubscriptionUpgradeRequest
- SubscriptionUsage
- Tool
- ToolCall
- ToolCallFunction
- ToolChoiceFunction
- ToolChoiceFunctionFunction
- ToolFunction
- UpdateSpendingLimitRequest
- Usage
- UsageBucket
- UsageCompletionTokensDetails
- UsagePage
- UsagePromptTokensDetails
- VideoCreateRequest
- VideoJob
- VideoList
- WebhookEndpoint
- WebhookEndpointPage
- WeightsVerification
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.19 - 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