{"id":22089842,"url":"https://github.com/speakeasy-api/speakeasy-client-sdk-csharp","last_synced_at":"2025-06-19T13:35:15.550Z","repository":{"id":180741882,"uuid":"644411673","full_name":"speakeasy-api/speakeasy-client-sdk-csharp","owner":"speakeasy-api","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-13T00:24:48.000Z","size":1786,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-13T01:30:29.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/speakeasy-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-23T13:13:12.000Z","updated_at":"2025-01-14T14:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"be48420f-2ece-4c0e-9f25-3c863c7486e9","html_url":"https://github.com/speakeasy-api/speakeasy-client-sdk-csharp","commit_stats":null,"previous_names":["speakeasy-api/speakeasy-client-sdk-csharp"],"tags_count":75,"template":false,"template_full_name":null,"purl":"pkg:github/speakeasy-api/speakeasy-client-sdk-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fspeakeasy-client-sdk-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fspeakeasy-client-sdk-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fspeakeasy-client-sdk-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fspeakeasy-client-sdk-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speakeasy-api","download_url":"https://codeload.github.com/speakeasy-api/speakeasy-client-sdk-csharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fspeakeasy-client-sdk-csharp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260759832,"owners_count":23058493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T02:14:27.316Z","updated_at":"2025-06-19T13:35:10.540Z","avatar_url":"https://github.com/speakeasy-api.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speakeasy\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\nSpeakeasy API: The Speakeasy API allows teams to manage common operations with their APIs\n\nFor more information about the API: [The Speakeasy Platform Documentation](/docs)\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\n* [SDK Installation](#sdk-installation)\n* [SDK Example Usage](#sdk-example-usage)\n* [Available Resources and Operations](#available-resources-and-operations)\n* [Global Parameters](#global-parameters)\n* [Retries](#retries)\n* [Error Handling](#error-handling)\n* [Server Selection](#server-selection)\n* [Authentication](#authentication)\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\n### NuGet\n\nTo add the [NuGet](https://www.nuget.org/) package to a .NET project:\n```bash\ndotnet add package SpeakeasySDK\n```\n\n### Locally\n\nTo add a reference to a local instance of the SDK in a .NET project:\n```bash\ndotnet add reference src/SpeakeasySDK/SpeakeasySDK.csproj\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing System.Collections.Generic;\nusing SpeakeasySDK.Models.Shared;\n\nvar sdk = new SDK(security: new Security() {\n    APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n});\n\nGetApisRequest req = new GetApisRequest() {};\n\nvar res = await sdk.Apis.GetApisAsync(req);\n\n// handle response\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [ApiEndpoints](docs/sdks/apiendpoints/README.md)\n\n* [DeleteApiEndpoint](docs/sdks/apiendpoints/README.md#deleteapiendpoint) - Delete an ApiEndpoint.\n* [FindApiEndpoint](docs/sdks/apiendpoints/README.md#findapiendpoint) - Find an ApiEndpoint via its displayName.\n* [GenerateOpenApiSpecForApiEndpoint](docs/sdks/apiendpoints/README.md#generateopenapispecforapiendpoint) - Generate an OpenAPI specification for a particular ApiEndpoint.\n* [GeneratePostmanCollectionForApiEndpoint](docs/sdks/apiendpoints/README.md#generatepostmancollectionforapiendpoint) - Generate a Postman collection for a particular ApiEndpoint.\n* [GetAllApiEndpoints](docs/sdks/apiendpoints/README.md#getallapiendpoints) - Get all Api endpoints for a particular apiID.\n* [GetAllForVersionApiEndpoints](docs/sdks/apiendpoints/README.md#getallforversionapiendpoints) - Get all ApiEndpoints for a particular apiID and versionID.\n* [GetApiEndpoint](docs/sdks/apiendpoints/README.md#getapiendpoint) - Get an ApiEndpoint.\n* [UpsertApiEndpoint](docs/sdks/apiendpoints/README.md#upsertapiendpoint) - Upsert an ApiEndpoint.\n\n### [Apis](docs/sdks/apis/README.md)\n\n* [DeleteApi](docs/sdks/apis/README.md#deleteapi) - Delete an Api.\n* [GenerateOpenApiSpec](docs/sdks/apis/README.md#generateopenapispec) - Generate an OpenAPI specification for a particular Api.\n* [GeneratePostmanCollection](docs/sdks/apis/README.md#generatepostmancollection) - Generate a Postman collection for a particular Api.\n* [GetAllApiVersions](docs/sdks/apis/README.md#getallapiversions) - Get all Api versions for a particular ApiEndpoint.\n* [GetApis](docs/sdks/apis/README.md#getapis) - Get a list of Apis for a given workspace\n* [UpsertApi](docs/sdks/apis/README.md#upsertapi) - Upsert an Api\n\n### [Artifacts](docs/sdks/artifacts/README.md)\n\n* [GetBlob](docs/sdks/artifacts/README.md#getblob) - Get blob for a particular digest\n* [GetManifest](docs/sdks/artifacts/README.md#getmanifest) - Get manifest for a particular reference\n* [GetNamespaces](docs/sdks/artifacts/README.md#getnamespaces) - Each namespace contains many revisions.\n* [GetOASSummary](docs/sdks/artifacts/README.md#getoassummary)\n* [GetRevisions](docs/sdks/artifacts/README.md#getrevisions)\n* [GetTags](docs/sdks/artifacts/README.md#gettags)\n* [PostTags](docs/sdks/artifacts/README.md#posttags) - Add tags to an existing revision\n* [Preflight](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints\n\n### [Auth](docs/sdks/auth/README.md)\n\n* [GetAccessToken](docs/sdks/auth/README.md#getaccesstoken) - Get or refresh an access token for the current workspace.\n* [GetUser](docs/sdks/auth/README.md#getuser) - Get information about the current user.\n* [GetWorkspaceAccess](docs/sdks/auth/README.md#getworkspaceaccess) - Get access allowances for a particular workspace\n* [ValidateApiKey](docs/sdks/auth/README.md#validateapikey) - Validate the current api key.\n\n### [Embeds](docs/sdks/embeds/README.md)\n\n* [GetEmbedAccessToken](docs/sdks/embeds/README.md#getembedaccesstoken) - Get an embed access token for the current workspace.\n* [GetValidEmbedAccessTokens](docs/sdks/embeds/README.md#getvalidembedaccesstokens) - Get all valid embed access tokens for the current workspace.\n* [RevokeEmbedAccessToken](docs/sdks/embeds/README.md#revokeembedaccesstoken) - Revoke an embed access EmbedToken.\n\n### [Events](docs/sdks/events/README.md)\n\n* [GetWorkspaceEventsByTarget](docs/sdks/events/README.md#getworkspaceeventsbytarget) - Load recent events for a particular workspace\n* [GetWorkspaceTargets](docs/sdks/events/README.md#getworkspacetargets) - Load targets for a particular workspace\n* [PostWorkspaceEvents](docs/sdks/events/README.md#postworkspaceevents) - Post events for a specific workspace\n* [SearchWorkspaceEvents](docs/sdks/events/README.md#searchworkspaceevents) - Search events for a particular workspace by any field\n\n### [Github](docs/sdks/github/README.md)\n\n* [CheckAccess](docs/sdks/github/README.md#checkaccess)\n* [ConfigureCodeSamples](docs/sdks/github/README.md#configurecodesamples)\n* [ConfigureMintlifyRepo](docs/sdks/github/README.md#configuremintlifyrepo)\n* [ConfigureTarget](docs/sdks/github/README.md#configuretarget)\n* [FetchPublishingPRs](docs/sdks/github/README.md#fetchpublishingprs)\n* [GetAction](docs/sdks/github/README.md#getaction)\n* [GithubCheckPublishingSecrets](docs/sdks/github/README.md#githubcheckpublishingsecrets)\n* [GithubStorePublishingSecrets](docs/sdks/github/README.md#githubstorepublishingsecrets)\n* [TriggerAction](docs/sdks/github/README.md#triggeraction)\n\n### [Metadata](docs/sdks/metadata/README.md)\n\n* [DeleteVersionMetadata](docs/sdks/metadata/README.md#deleteversionmetadata) - Delete metadata for a particular apiID and versionID.\n* [GetVersionMetadata](docs/sdks/metadata/README.md#getversionmetadata) - Get all metadata for a particular apiID and versionID.\n* [InsertVersionMetadata](docs/sdks/metadata/README.md#insertversionmetadata) - Insert metadata for a particular apiID and versionID.\n\n### [Organizations](docs/sdks/organizations/README.md)\n\n* [CreateFreeTrial](docs/sdks/organizations/README.md#createfreetrial) - Create a free trial for an organization\n* [GetOrganization](docs/sdks/organizations/README.md#getorganization) - Get organization\n* [GetOrganizationUsage](docs/sdks/organizations/README.md#getorganizationusage) - Get billing usage summary for a particular organization\n* [GetOrganizations](docs/sdks/organizations/README.md#getorganizations) - Get organizations for a user\n\n### [Reports](docs/sdks/reports/README.md)\n\n* [GetChangesReportSignedUrl](docs/sdks/reports/README.md#getchangesreportsignedurl) - Get the signed access url for the change reports for a particular document.\n* [GetLintingReportSignedUrl](docs/sdks/reports/README.md#getlintingreportsignedurl) - Get the signed access url for the linting reports for a particular document.\n* [UploadReport](docs/sdks/reports/README.md#uploadreport) - Upload a report.\n\n### [Requests](docs/sdks/requests/README.md)\n\n* [GenerateRequestPostmanCollection](docs/sdks/requests/README.md#generaterequestpostmancollection) - Generate a Postman collection for a particular request.\n* [GetRequestFromEventLog](docs/sdks/requests/README.md#getrequestfromeventlog) - Get information about a particular request.\n* [QueryEventLog](docs/sdks/requests/README.md#queryeventlog) - Query the event log to retrieve a list of requests.\n\n### [Schemas](docs/sdks/schemas/README.md)\n\n* [DeleteSchema](docs/sdks/schemas/README.md#deleteschema) - Delete a particular schema revision for an Api.\n* [DownloadSchema](docs/sdks/schemas/README.md#downloadschema) - Download the latest schema for a particular apiID.\n* [DownloadSchemaRevision](docs/sdks/schemas/README.md#downloadschemarevision) - Download a particular schema revision for an Api.\n* [GetSchema](docs/sdks/schemas/README.md#getschema) - Get information about the latest schema.\n* [GetSchemaDiff](docs/sdks/schemas/README.md#getschemadiff) - Get a diff of two schema revisions for an Api.\n* [GetSchemaRevision](docs/sdks/schemas/README.md#getschemarevision) - Get information about a particular schema revision for an Api.\n* [GetSchemas](docs/sdks/schemas/README.md#getschemas) - Get information about all schemas associated with a particular apiID.\n* [RegisterSchema](docs/sdks/schemas/README.md#registerschema) - Register a schema.\n\n\n### [ShortURLs](docs/sdks/shorturls/README.md)\n\n* [Create](docs/sdks/shorturls/README.md#create) - Shorten a URL.\n\n### [Suggest](docs/sdks/suggest/README.md)\n\n* [Suggest](docs/sdks/suggest/README.md#suggest) - Generate suggestions for improving an OpenAPI document.\n* [SuggestOpenAPI](docs/sdks/suggest/README.md#suggestopenapi) - (DEPRECATED) Generate suggestions for improving an OpenAPI document.\n* [SuggestOpenAPIRegistry](docs/sdks/suggest/README.md#suggestopenapiregistry) - Generate suggestions for improving an OpenAPI document stored in the registry.\n\n### [Workspaces](docs/sdks/workspaces/README.md)\n\n* [GetWorkspace](docs/sdks/workspaces/README.md#getworkspace) - Get workspace\n* [GetWorkspaceFeatureFlags](docs/sdks/workspaces/README.md#getworkspacefeatureflags) - Get workspace feature flags\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Select Server by Name\n\nYou can override the default server globally by passing a server name to the `server: string` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:\n\n| Name | Server | Variables |\n| ----- | ------ | --------- |\n| `prod` | `https://api.prod.speakeasyapi.dev` | None |\n\n\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example:\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security schemes globally:\n\n| Name        | Type        | Scheme      |\n| ----------- | ----------- | ----------- |\n| `APIKey`    | apiKey      | API key     |\n| `Bearer`    | http        | HTTP Bearer |\n\nYou 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:\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing SpeakeasySDK.Models.Shared;\n\nvar sdk = new SDK(security: new Security() {\n    APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n});\n\nDeleteApiRequest req = new DeleteApiRequest() {\n    ApiID = \"\u003cvalue\u003e\",\n    VersionID = \"\u003cvalue\u003e\",\n};\n\nvar res = await sdk.Apis.DeleteApiAsync(req);\n\n// handle response\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Start Global Parameters [global-parameters] --\u003e\n## Global Parameters\n\n## Global Parameters\n\nA parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.\n\nFor example, you can set `workspaceID` to `\"\u003cvalue\u003e\"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetWorkspace`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.\n\n\n### Available Globals\n\nThe following global parameter is available.\n\n| Name | Type | Required | Description |\n| ---- | ---- |:--------:| ----------- |\n| workspaceID | string |  | The WorkspaceID parameter. |\n\n\n### Example\n\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing SpeakeasySDK.Models.Shared;\n\nvar sdk = new SDK(security: new Security() {\n    APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n});\n\nGetWorkspaceRequest req = new GetWorkspaceRequest() {};\n\nvar res = await sdk.Workspaces.GetWorkspaceAsync(req);\n\n// handle response\n```\n\u003c!-- End Global Parameters [global-parameters] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nHandling errors in this SDK should largely match your expectations.  All operations return a response object or thow an exception.  If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.\n\n| Error Object                            | Status Code                             | Content Type                            |\n| --------------------------------------- | --------------------------------------- | --------------------------------------- |\n| SpeakeasySDK.Models.Errors.Error        | 5XX                                     | application/json                        |\n| SpeakeasySDK.Models.Errors.SDKException | 4xx-5xx                                 | */*                                     |\n\n### Example\n\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing SpeakeasySDK.Models.Shared;\nusing System;\nusing SpeakeasySDK.Models.Errors;\n\nvar sdk = new SDK(security: new Security() {\n    APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n});\n\ntry\n{\n    GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() {};\n\n    var res = await sdk.Workspaces.GetWorkspaceFeatureFlagsAsync(req);\n\n    // handle response\n}\ncatch (Exception ex)\n{\n    if (ex is Error)\n    {\n        // handle exception\n    }\n    else if (ex is SpeakeasySDK.Models.Errors.SDKException)\n    {\n        // handle exception\n    }\n}\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing SpeakeasySDK.Models.Shared;\n\nvar sdk = new SDK(security: new Security() {\n    APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n});\n\nGetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {};\n\nvar res = await sdk.Auth.GetWorkspaceAccessAsync(\n    retryConfig: new RetryConfig(\n        strategy: RetryConfig.RetryStrategy.BACKOFF,\n        backoff: new BackoffStrategy(\n            initialIntervalMs: 1L,\n            maxIntervalMs: 50L,\n            maxElapsedTimeMs: 100L,\n            exponent: 1.1\n        ),\n        retryConnectionErrors: false\n    ),req);\n\n// handle response\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:\n```csharp\nusing SpeakeasySDK;\nusing SpeakeasySDK.Models.Operations;\nusing SpeakeasySDK.Models.Shared;\n\nvar sdk = new SDK(\n    retryConfig: new RetryConfig(\n        strategy: RetryConfig.RetryStrategy.BACKOFF,\n        backoff: new BackoffStrategy(\n            initialIntervalMs: 1L,\n            maxIntervalMs: 50L,\n            maxElapsedTimeMs: 100L,\n            exponent: 1.1\n        ),\n        retryConnectionErrors: false\n    ),\n    security: new Security() {\n        APIKey = \"\u003cYOUR_API_KEY_HERE\u003e\",\n    }\n);\n\nGetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {};\n\nvar res = await sdk.Auth.GetWorkspaceAccessAsync(req);\n\n// handle response\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n\n\n### Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n### Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-api%2Fspeakeasy-client-sdk-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeakeasy-api%2Fspeakeasy-client-sdk-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-api%2Fspeakeasy-client-sdk-csharp/lists"}