OpenAPI Specification
Spec Sources
Silhouette publishes OpenAPI specifications for generating strongly-typed client integrations.
| API | Spec URL | Notes |
|---|---|---|
| REST API v1/RFQ | /api/rfq-openapi.yaml | OpenAPI source for the generated RFQ API Spec section |
/v0 operation API | https://api.silhouette.exchange/v0/openapi.json | Live OpenAPI JSON for the operation-style API |
The REST API v1 spec also has a dedicated docs section:
For a ready-to-use client for the existing operation API, see the Python SDK.
Using the OpenAPI Specification
What Is OpenAPI?
OpenAPI (formerly known as Swagger) is a standard specification format for describing RESTful APIs. It provides a machine-readable description of your API's endpoints, request/response formats, authentication methods, and more.
Generate Client Libraries
You can use the OpenAPI Generator tool to automatically generate client SDKs in your preferred programming language.
The examples below use the REST API v1/RFQ spec. To generate a client for the existing /v0 operation API instead, replace the input URL with https://api.silhouette.exchange/v0/openapi.json.
Example: Generate a TypeScript Client
# Install the OpenAPI Generator CLI
npm install @openapitools/openapi-generator-cli -g
# Generate a TypeScript Axios client
openapi-generator-cli generate \
-i https://docs.silhouette.exchange/api/rfq-openapi.yaml \
-g typescript-axios \
-o ./generated-client
Example: Generate a Python Client
openapi-generator-cli generate \
-i https://docs.silhouette.exchange/api/rfq-openapi.yaml \
-g python \
-o ./generated-client
The generator supports many languages including JavaScript, TypeScript, Python, Java, Go, Rust, PHP, Ruby, and more. See the OpenAPI Generator documentation for a complete list.
Benefits of Using Generated Clients
- Type safety: Generated clients include full type definitions for all operations and data structures
- Validation: Built-in request/response validation based on the OpenAPI schema
- Auto-completion: IDE support for all API methods and parameters
- Documentation: Inline documentation from the OpenAPI spec
- Consistency: Guaranteed compatibility with the API specification
Interactive Documentation
You can also use the OpenAPI specification with Swagger UI to create interactive API documentation:
# Using Docker
docker run -p 8080:8080 \
-e SWAGGER_JSON_URL=https://docs.silhouette.exchange/api/rfq-openapi.yaml \
swaggerapi/swagger-ui
Then visit http://localhost:8080 to explore the API interactively.
Resources
- OpenAPI Specification Documentation - Learn about the OpenAPI spec format
- OpenAPI Generator - Generate client SDKs, server stubs, and API documentation
- OpenAPI Generator Generators List - See all supported languages
- Swagger UI - Interactive API documentation
- RFQ API Spec - REST API v1/RFQ endpoint documentation
- Silhouette API Reference - Complete operation documentation
- Silhouette API Quick Start - Get started with your first API call