1616<!-- Start Summary [summary] -->
1717## Summary
1818
19- Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events
19+ Speakeasy API: The Speakeasy API allows teams to manage common operations with their APIs
20+ The Subscriptions API manages subscriptions for CLI and registry events
2021
2122For more information about the API: [ The Speakeasy Platform Documentation] ( /docs )
2223<!-- End Summary [summary] -->
@@ -103,8 +104,6 @@ Add the following server definition to your `claude_desktop_config.json` file:
103104 " --" ,
104105 " mcp" , " start" ,
105106 " --api-key" , " ..." ,
106- " --bearer" , " ..." ,
107- " --workspace-identifier" , " ..." ,
108107 " --workspace-id" , " ..."
109108 ]
110109 }
@@ -129,8 +128,6 @@ Create a `.cursor/mcp.json` file in your project root with the following content
129128 " --" ,
130129 " mcp" , " start" ,
131130 " --api-key" , " ..." ,
132- " --bearer" , " ..." ,
133- " --workspace-identifier" , " ..." ,
134131 " --workspace-id" , " ..."
135132 ]
136133 }
@@ -179,11 +176,7 @@ npx -y --package @speakeasy-api/speakeasy-client-sdk-typescript -- mcp start --h
179176``` typescript
180177import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
181178
182- const speakeasy = new Speakeasy ({
183- security: {
184- apiKey: " <YOUR_API_KEY_HERE>" ,
185- },
186- });
179+ const speakeasy = new Speakeasy ();
187180
188181async function run() {
189182 await speakeasy .artifacts .createRemoteSource ();
@@ -345,11 +338,7 @@ run();
345338import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
346339import * as errors from " @speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/errors" ;
347340
348- const speakeasy = new Speakeasy ({
349- security: {
350- apiKey: " <YOUR_API_KEY_HERE>" ,
351- },
352- });
341+ const speakeasy = new Speakeasy ();
353342
354343async function run() {
355344 try {
@@ -420,9 +409,6 @@ import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
420409
421410const speakeasy = new Speakeasy ({
422411 server: " prod" ,
423- security: {
424- apiKey: " <YOUR_API_KEY_HERE>" ,
425- },
426412});
427413
428414async function run() {
@@ -441,9 +427,6 @@ import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
441427
442428const speakeasy = new Speakeasy ({
443429 serverURL: " https://api.prod.speakeasy.com" ,
444- security: {
445- apiKey: " <YOUR_API_KEY_HERE>" ,
446- },
447430});
448431
449432async function run() {
@@ -517,22 +500,18 @@ const sdk = new Speakeasy({ httpClient: httpClient });
517500
518501### Per-Client Security Schemes
519502
520- This SDK supports the following security schemes globally:
503+ This SDK supports the following security scheme globally:
521504
522- | Name | Type | Scheme |
523- | --------------------- | ------ | ----------- |
524- | ` apiKey ` | apiKey | API key |
525- | ` bearer ` | http | HTTP Bearer |
526- | ` workspaceIdentifier ` | apiKey | API key |
505+ | Name | Type | Scheme |
506+ | -------- | ------ | ------- |
507+ | ` apiKey ` | apiKey | API key |
527508
528- You can set the security parameters through the ` security ` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it . For example:
509+ To authenticate with the API the ` apiKey ` parameter must be set when initializing the SDK client instance. For example:
529510``` typescript
530511import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
531512
532513const speakeasy = new Speakeasy ({
533- security: {
534- apiKey: " <YOUR_API_KEY_HERE>" ,
535- },
514+ apiKey: " <YOUR_API_KEY_HERE>" ,
536515});
537516
538517async function run() {
@@ -541,6 +520,24 @@ async function run() {
541520
542521run ();
543522
523+ ```
524+
525+ ### Per-Operation Security Schemes
526+
527+ Some operations in this SDK require the security scheme to be specified at the request level. For example:
528+ ``` typescript
529+ import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
530+
531+ const speakeasy = new Speakeasy ();
532+
533+ async function run() {
534+ const result = await speakeasy .auth .getAccess ({}, {});
535+
536+ console .log (result );
537+ }
538+
539+ run ();
540+
544541```
545542<!-- End Authentication [security] -->
546543
@@ -553,11 +550,7 @@ To change the default retry strategy for a single API call, simply provide a ret
553550``` typescript
554551import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
555552
556- const speakeasy = new Speakeasy ({
557- security: {
558- apiKey: " <YOUR_API_KEY_HERE>" ,
559- },
560- });
553+ const speakeasy = new Speakeasy ();
561554
562555async function run() {
563556 await speakeasy .artifacts .createRemoteSource (undefined , {
@@ -593,9 +586,6 @@ const speakeasy = new Speakeasy({
593586 },
594587 retryConnectionErrors: false ,
595588 },
596- security: {
597- apiKey: " <YOUR_API_KEY_HERE>" ,
598- },
599589});
600590
601591async function run() {
@@ -867,14 +857,12 @@ Here's an example of one such pagination call:
867857``` typescript
868858import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
869859
870- const speakeasy = new Speakeasy ({
871- security: {
872- apiKey: " <YOUR_API_KEY_HERE>" ,
873- },
874- });
860+ const speakeasy = new Speakeasy ();
875861
876862async function run() {
877- const result = await speakeasy .events .getTargetsSummary ({});
863+ const result = await speakeasy .events .getTargetsSummary ({
864+ apiKey: " <YOUR_API_KEY_HERE>" ,
865+ }, {});
878866
879867 for await (const page of result ) {
880868 console .log (page );
@@ -904,14 +892,12 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
904892import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
905893import { openAsBlob } from " node:fs" ;
906894
907- const speakeasy = new Speakeasy ({
908- security: {
909- apiKey: " <YOUR_API_KEY_HERE>" ,
910- },
911- });
895+ const speakeasy = new Speakeasy ();
912896
913897async function run() {
914898 const result = await speakeasy .codeSamples .generateCodeSamplePreview ({
899+ apiKey: " <YOUR_API_KEY_HERE>" ,
900+ }, {
915901 language: " <value>" ,
916902 schemaFile: await openAsBlob (" example.file" ),
917903 });
0 commit comments