# Speakeasy CodeSamples API

**Canonical:** https://apis.io/apis/speakeasy-api/speakeasy-api-codesamples-api/  
**Provider:** Speakeasy — https://apis.io/providers/speakeasy-api/  
**Base URL:** https://api.prod.speakeasy.com  
**Documentation:** https://www.speakeasy.com/guides/openapi/publish-specs-to-api-registry

Speakeasy CodeSamples API is one of 13 APIs that [Speakeasy](https://apis.io/providers/speakeasy-api/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include CodeSamples. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, and an API reference.

REST APIs for retrieving Code Samples

## Operations (4)

| Method | Path | Summary |
|---|---|---|
| GET | `/v1/code_sample` | Retrieve usage snippets |
| POST | `/v1/code_sample/preview` | Generate Code Sample previews from a file and configuration parameters. |
| POST | `/v1/code_sample/preview/async` | Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. |
| GET | `/v1/code_sample/preview/async/{jobID}` | Poll for the result of an asynchronous Code Sample preview generation. |

## Machine-readable artifacts (8)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/speakeasy-api/refs/heads/main/openapi/speakeasy-api-codesamples-api-openapi.yml
- **Documentation** — https://www.speakeasy.com/guides/openapi/publish-specs-to-api-registry
- **APIReference** — https://www.speakeasy.com/openapi.yaml
- **PostmanCollection** — https://raw.githubusercontent.com/api-evangelist/speakeasy-api/refs/heads/main/collections/speakeasy-api.postman_collection.json
- **OpenCollection** — https://raw.githubusercontent.com/api-evangelist/speakeasy-api/refs/heads/main/collections/speakeasy-api.opencollection.json
- **Documentation** — https://www.speakeasy.com/docs
- **Documentation** — https://www.speakeasy.com/docs/sdks/create-client-sdks
- **Documentation** — https://www.speakeasy.com/docs/prep-openapi/linting

## Other Speakeasy APIs (12)

- [Speakeasy Artifacts API](https://apis.io/apis/speakeasy-api/speakeasy-api-artifacts-api/)
- [Speakeasy Auth API](https://apis.io/apis/speakeasy-api/speakeasy-api-auth-api/)
- [Speakeasy Events API](https://apis.io/apis/speakeasy-api/speakeasy-api-events-api/)
- [Speakeasy Github API](https://apis.io/apis/speakeasy-api/speakeasy-api-github-api/)
- [Speakeasy Organizations API](https://apis.io/apis/speakeasy-api/speakeasy-api-organizations-api/)
- [Speakeasy PublishingTokens API](https://apis.io/apis/speakeasy-api/speakeasy-api-publishingtokens-api/)
- [Speakeasy Reports API](https://apis.io/apis/speakeasy-api/speakeasy-api-reports-api/)
- [Speakeasy SchemaStore API](https://apis.io/apis/speakeasy-api/speakeasy-api-schemastore-api/)
- [Speakeasy ShortURLs API](https://apis.io/apis/speakeasy-api/speakeasy-api-shorturls-api/)
- [Speakeasy Subscriptions API](https://apis.io/apis/speakeasy-api/speakeasy-api-subscriptions-api/)
- [Speakeasy Suggest API](https://apis.io/apis/speakeasy-api/speakeasy-api-suggest-api/)
- [Speakeasy Workspaces API](https://apis.io/apis/speakeasy-api/speakeasy-api-workspaces-api/)

## Tags

CodeSamples

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/speakeasy-api/speakeasy-api-codesamples-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/speakeasy-api/.
