Package Exports
- @deepgram/sdk
- @deepgram/sdk/dist/main/index.js
- @deepgram/sdk/dist/module/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@deepgram/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Deepgram Node.js SDK
Official Node.js SDK for Deepgram. Power your apps with world-class speech and Language AI models.
This SDK only supports hosted usage of api.deepgram.com.
Deprecated JS Browser SDK
As of version 2.x, the JS Browser SDK was removed from the Node SDK and will become an independent Client SDK. To use the older SDK, please
npm i @deepgram/sdk@1.2.1and use@deepgram/sdk/browser.
- Deepgram Node.js SDK
- Getting an API Key
- Installation
- Constructor
- Transcription
- Projects
- Keys
- Members
- Scopes
- Invitations
- Usage
- Billing
- Development and Contributing
- Getting Help
Getting an API Key
🔑 To access the Deepgram API you will need a free Deepgram API Key.
Installation
npm install @deepgram/sdk
# - or -
# yarn add @deepgram/sdkConstructor
const { Deepgram } = require("@deepgram/sdk");
// - or -
// import { Deepgram } from "@deepgram/sdk";
const deepgram = new Deepgram(DEEPGRAM_API_KEY);Transcription
Remote Files
const response = await deepgram.transcription.preRecorded(
{ url: URL_OF_FILE },
options
);See our API reference for more info.
Local Files
const response = await deepgram.transcription.preRecorded(
{
stream: fs.createReadStream("/path/to/file"),
mimetype: MIMETYPE_OF_FILE,
},
options
);See our API reference for more info.
Live Audio
const ws = dg.transcription.live(options);
// source.addListener('got-some-audio', async (event) => {
ws.send(event);
// })See an example, here: https://github.com/deepgram-devs/node-live-example.
See our API reference for more info.
Projects
Get Projects
Returns all projects accessible by the API key.
const result = await deepgram.projects.list();See our API reference for more info.
Get Project
Retrieves a specific project based on the provided project_id.
const result = await deepgram.projects.get(project_id);See our API reference for more info.
Update Project
Update a project.
const result = await deepgram.projects.update(project_id, options);See our API reference for more info.
Delete Project
Delete a project.
await deepgram.projects.delete(project_id);See our API reference for more info.
Keys
List Keys
Retrieves all keys associated with the provided project_id.
const result = await deepgram.keys.list(project_id);See our API reference for more info.
Get Key
Retrieves a specific key associated with the provided project_id.
const result = await deepgram.keys.get(project_id, key_id);See our API reference for more info.
Create Key
Creates an API key with the provided scopes.
let scopes = ["member", "etc"];
const result = await deepgram.keys.create(project_id, comment, scopes, options);See our API reference for more info.
Delete Key
Deletes a specific key associated with the provided project_id.
await deepgram.keys.delete(project_id, key_id);See our API reference for more info.
Members
Get Members
Retrieves account objects for all of the accounts in the specified project_id.
const result = await deepgram.members.listMembers(project_id);See our API reference for more info.
Remove Member
Removes member account for specified member_id.
const result = await deepgram.members.removeMember(project_id, member_id);See our API reference for more info.
Scopes
Get Member Scopes
Retrieves scopes of the specified member in the specified project.
const result = await deepgram.scopes.get(project_id, member_id);See our API reference for more info.
Update Scope
Updates the scope for the specified member in the specified project.
let scope = "member:read";
const result = await deepgram.scopes.update(project_id, member_id, scope);See our API reference for more info.
Invitations
List Invites
Retrieves all invitations associated with the provided project_id.
const result = await deepgram.invitations.list(project_id);See our API reference for more info.
Send Invite
Sends an invitation to the provided email address.
const result = await deepgram.invitation.send(project_id, options);See our API reference for more info.
Delete Invite
Removes the specified invitation from the project.
let email = "devrel@deepgram.com";
const result = await deepgram.invitation.delete(project_id, email);See our API reference for more info.
Leave Project
Removes the authenticated user from the project.
const result = await deepgram.invitation.leave(project_id);See our API reference for more info.
Usage
Get All Requests
Retrieves all requests associated with the provided project_id based on the provided options.
const result = await deepgram.usage.listRequests(project_id, options);See our API reference for more info.
Get Request
Retrieves a specific request associated with the provided project_id.
const result = await deepgram.usage.getRequest(project_id, request_id);See our API reference for more info.
Summarize Usage
Retrieves usage associated with the provided project_id based on the provided options.
const result = await deepgram.usage.getUsage(project_id, options);See our API reference for more info.
Get Fields
Lists the features, models, tags, languages, and processing method used for requests in the specified project.
const result = await deepgram.usage.getFields(project_id, options);See our API reference for more info.
Billing
Get All Balances
Retrieves the list of balance info for the specified project.
const result = await deepgram.billing.listBalances(project_id);See our API reference for more info.
Get Balance
Retrieves the balance info for the specified project and balance_id.
const result = await deepgram.billing.getBalance(project_id, balance_id);See our API reference for more info.
Development and Contributing
Interested in contributing? We ❤️ pull requests!
To make sure our community is safe for all, be sure to review and agree to our Code of Conduct. Then see the Contribution guidelines for more information.
Getting Help
We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either: