Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update apiKeyHeader to apiKey #20

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Instantiate and use the client with the following:
```typescript
import { CartesiaClient } from "@cartesia/cartesia-js";

const client = new CartesiaClient({ apiKeyHeader: "YOUR_API_KEY_HEADER" });
const client = new CartesiaClient({ apiKey: "YOUR_API_KEY_HEADER" });
await client.tts.bytes({
modelId: "sonic-english",
transcript: "Hello, world!",
Expand All @@ -47,7 +47,7 @@ await client.tts.bytes({
import { CartesiaClient } from "@cartesia/cartesia-js";

const cartesia = new CartesiaClient({
apiKeyHeader: "your-api-key",
apiKey: "your-api-key",
});

// Initialize the WebSocket. Make sure the output format you specify is supported.
Expand Down
2 changes: 1 addition & 1 deletion src/wrapper/Websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default class Websocket {
(await core.Supplier.get(this.options.environment)) ?? environments.CartesiaEnvironment.Production
).replace(/^https?:\/\//, "");
const params = {
api_key: this.options.apiKeyHeader,
api_key: this.options.apiKey,
cartesia_version: this.options.cartesiaVersion,
};
return `wss://${baseUrl}/tts/websocket${qs.stringify(params, { addQueryPrefix: true })}`;
Expand Down
Loading