Loading...
Loading...
Generate OpenAPI 3.2.0 specifications for third-party APIs (OpenAI, Anthropic, Google, Microsoft, Stripe, GitHub, Slack, AWS, and more)
npx skill4agent add deepparser/oas-api-spec-generator oas-api-spec-generatorProvider documentation URLs (use these as starting points):
OpenAI: https://platform.openai.com/docs/api-reference
Anthropic: https://docs.anthropic.com/en/api
Google AI: https://ai.google.dev/api/rest
Microsoft Graph: https://learn.microsoft.com/en-us/graph/api/overview
Azure OpenAI: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
Stripe: https://stripe.com/docs/api
GitHub: https://docs.github.com/en/rest
Slack: https://api.slack.com/methods
AWS (various): https://docs.aws.amazon.com/
Twilio: https://www.twilio.com/docs/usage/api
SendGrid: https://docs.sendgrid.com/api-reference
Cloudflare: https://developers.cloudflare.com/api/
Vercel: https://vercel.com/docs/rest-api
Supabase: https://supabase.com/docs/reference
Firebase: https://firebase.google.com/docs/reference/restOfficial OpenAPI specs (fetch and use as reference/base):
OpenAI: https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml
GitHub: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml
Stripe: https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.yaml
Microsoft Graph: https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/openapi/v1.0/openapi.yaml
Anthropic: https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/main/api.yaml (if available)openapi: 3.2.0
info:
title: "{Provider Name} API"
version: "{API version from provider docs}"
description: |
OpenAPI 3.2.0 specification for the {Provider Name} API.
Auto-generated from official documentation.
Source: {documentation URL}
Generated: {date}
contact:
name: "{Provider Name} API Support"
url: "{provider support URL}"
license:
name: "API Terms of Service"
url: "{provider ToS URL}"
x-generated-by: "OAS API Spec Generator Skill"
x-source-documentation: "{documentation URL}"
servers:
- url: "{base URL}"
description: "Production"
# Add sandbox/staging if available
security:
- {default security scheme}: []
tags:
# Use structured tags (OAS 3.2 feature)
- name: "{Resource Group}"
summary: "{Description}"
kind: resource # or: operation, webhook, admin
# parent: "{Parent Tag}" # For hierarchical grouping
paths:
# Endpoint definitions...
webhooks:
# If the API supports webhooks...
components:
schemas:
# Data models...
parameters:
# Reusable parameters...
responses:
# Standard error responses...
securitySchemes:
# Auth methods...
mediaTypes:
# Reusable media types (OAS 3.2 feature)
externalDocs:
description: "Official {Provider} API Documentation"
url: "{docs URL}"components:
securitySchemes:
apiKeyBearer:
type: http
scheme: bearer
description: |
API key passed as Bearer token.
Obtain from: {provider dashboard URL}
security:
- apiKeyBearer: []components:
securitySchemes:
apiKeyHeader:
type: apiKey
in: header
name: "x-api-key"
description: |
API key passed in custom header.
Obtain from: {provider dashboard URL}components:
securitySchemes:
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: "{auth URL}"
tokenUrl: "{token URL}"
refreshUrl: "{refresh URL}"
scopes:
"scope.read": "Read access"
"scope.write": "Write access"
# OAS 3.2: OAuth2 metadata URL
x-oauth2-metadata-url: "{provider}/.well-known/oauth-authorization-server"components:
securitySchemes:
oauth2ClientCredentials:
type: oauth2
flows:
clientCredentials:
tokenUrl: "{token URL}"
scopes:
".default": "Default scope"components:
securitySchemes:
awsSigV4:
type: apiKey
in: header
name: Authorization
description: |
AWS Signature Version 4.
See: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
x-amazon-apigateway-authtype: "awsSigv4"components:
securitySchemes:
apiKey:
type: http
scheme: bearer
orgHeader:
type: apiKey
in: header
name: "OpenAI-Organization"
description: "Optional organization ID"
# Per-operation security can combine:
# security:
# - apiKey: []
# orgHeader: []paths:
/v1/chat/completions:
post:
operationId: createChatCompletion
summary: Create chat completion
tags: [Chat]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionRequest'
responses:
'200':
description: Successful response
content:
# Non-streaming response
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionResponse'
# Streaming response (OAS 3.2 native)
text/event-stream:
schema:
type: string
itemSchema:
$ref: '#/components/schemas/ChatCompletionChunk'
x-stream-delimiter: "\n\n"responses:
'200':
content:
application/x-ndjson:
schema:
type: string
itemSchema:
$ref: '#/components/schemas/BatchResultLine'components:
schemas:
# Cursor-based (Stripe, Slack)
PaginatedList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/{Resource}'
has_more:
type: boolean
next_cursor:
type: string
nullable: true
# Offset-based (GitHub, many REST APIs)
PaginatedListOffset:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/{Resource}'
total_count:
type: integer
page:
type: integer
per_page:
type: integer
# OData-style (Microsoft Graph)
ODataCollection:
type: object
properties:
value:
type: array
items:
$ref: '#/components/schemas/{Resource}'
'@odata.count':
type: integer
'@odata.nextLink':
type: string
format: uri
nullable: truecomponents:
schemas:
# OpenAI/Anthropic style
APIError:
type: object
required: [error]
properties:
error:
type: object
required: [message, type]
properties:
message:
type: string
type:
type: string
enum: [invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, api_error]
param:
type: string
nullable: true
code:
type: string
nullable: true
# Microsoft Graph style
ODataError:
type: object
properties:
error:
type: object
properties:
code:
type: string
message:
type: string
innerError:
type: object
# Stripe style
StripeError:
type: object
properties:
error:
type: object
properties:
type:
type: string
enum: [api_error, card_error, idempotency_error, invalid_request_error]
message:
type: string
code:
type: string
param:
type: string
responses:
BadRequest:
description: Invalid request parameters
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
Unauthorized:
description: Authentication required or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
Forbidden:
description: Insufficient permissions
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
RateLimited:
description: Rate limit exceeded
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying
X-RateLimit-Limit:
schema:
type: integer
X-RateLimit-Remaining:
schema:
type: integer
X-RateLimit-Reset:
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
ServerError:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'https://api.openai.comAuthorization: Bearer sk-...OpenAI-OrganizationOpenAI-Projectstream: true/v1/chat/completions/v1/embeddings/v1/images/generations/v1/audio/transcriptions/v1/models/v1/files/v1/assistants/v1/threadshttps://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yamlafterOpenAI-Betahttps://api.anthropic.comx-api-keyanthropic-version2024-10-22stream: true/v1/messages/v1/messages/batches/v1/modelsanthropic-ratelimit-*https://generativelanguage.googleapis.com?key=streamGenerateContent/v1beta/models/{model}:generateContent/v1beta/models/{model}:streamGenerateContent/v1beta/models/{model}:embedContenthttps://graph.microsoft.com/v1.0/betahttps://login.microsoftonline.com/{tenant}/oauth2/v2.0/token/me/users/groups/drives/sites/teams@odata.nextLink$select$filter$expand$top$skip$orderbymicrosoftgraph/msgraph-metadataPOST /$batchhttps://api.stripe.comapplication/x-www-form-urlencoded/v1/customers/v1/charges/v1/payment_intents/v1/subscriptions/v1/invoicesStripe-Versionstarting_afterending_beforeStripe-SignatureIdempotency-Keystripe/openapihttps://api.github.com/repos/{owner}/{repo}/users/{username}/orgs/{org}/issues/pullsrel="next"per_pageX-RateLimit-*X-GitHub-Api-Version: 2022-11-28github/rest-api-descriptionhttps://slack.com/apiapplication/x-www-form-urlencodedapplication/json/chat.postMessage/conversations.list/users.list/files.uploadcursornext_cursorRetry-AfterAuthorization{service}.{region}.amazonaws.comhttps://api.cloudflare.com/client/v4X-Auth-EmailX-Auth-Key/zones/dns_records/workers/accountspageper_page{ success, errors, messages, result }https://api.vercel.com/v9/projects/v6/deployments/v1/domains/v1/teamshttps://api.twilio.com/2010-04-01application/x-www-form-urlencoded/Accounts/{sid}/Messages/Accounts/{sid}/CallsPageSizePageTokenhttps://api.sendgrid.com/v3/mail/send/marketing/contacts/templatesspecs/
├── {provider}/
│ ├── openapi.yaml # Entry document
│ ├── paths/
│ │ ├── {resource}.yaml # Per-resource paths
│ │ └── ...
│ ├── components/
│ │ ├── schemas/
│ │ │ ├── {Model}.yaml
│ │ │ └── ...
│ │ ├── parameters/
│ │ │ └── common.yaml
│ │ ├── responses/
│ │ │ └── errors.yaml
│ │ └── securitySchemes/
│ │ └── auth.yaml
│ └── README.md # Provider-specific notes$refpaths:
/users:
$ref: './paths/users.yaml#/~1users'
components:
schemas:
User:
$ref: './components/schemas/User.yaml'openapi3.2.0info.titleinfo.versionpathscomponentswebhooks$refoperationIdschemarequiredsecuritycomponents/securitySchemesgetpostputpatchdelete'200'200operationIdsummarydescription$reftext/event-streamapplication/x-ndjsonitemSchemaexamplesoperationId{verb}{Resource}createUserlistOrderskindparentexternalDocsx-generated-byx-source-documentationinfospecs/{provider}/openapi.yamlopenapi: 3.2.0
info:
title: OpenAI API
version: "2.3.0"
description: |
OpenAPI 3.2.0 specification for the OpenAI API.
Covers Chat Completions, Embeddings, and Models endpoints.
Source: https://platform.openai.com/docs/api-reference
contact:
name: OpenAI Support
url: https://help.openai.com
license:
name: MIT
identifier: MIT
x-generated-by: "OAS API Spec Generator Skill"
servers:
- url: https://api.openai.com
description: Production
security:
- bearerAuth: []
tags:
- name: Chat
summary: Chat completions
kind: resource
- name: Embeddings
summary: Text embeddings
kind: resource
- name: Models
summary: Model management
kind: resource
paths:
/v1/chat/completions:
post:
operationId: createChatCompletion
summary: Create a chat completion
tags: [Chat]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionRequest'
examples:
basic:
summary: Basic chat request
value:
model: gpt-4o
messages:
- role: user
content: "Hello!"
streaming:
summary: Streaming request
value:
model: gpt-4o
messages:
- role: user
content: "Hello!"
stream: true
responses:
'200':
description: Chat completion response
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionResponse'
text/event-stream:
schema:
type: string
itemSchema:
$ref: '#/components/schemas/ChatCompletionChunk'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
/v1/embeddings:
post:
operationId: createEmbedding
summary: Create embeddings
tags: [Embeddings]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmbeddingRequest'
responses:
'200':
description: Embedding response
content:
application/json:
schema:
$ref: '#/components/schemas/EmbeddingResponse'
/v1/models:
get:
operationId: listModels
summary: List available models
tags: [Models]
responses:
'200':
description: List of models
content:
application/json:
schema:
$ref: '#/components/schemas/ModelList'
/v1/models/{model_id}:
get:
operationId: getModel
summary: Retrieve a model
tags: [Models]
parameters:
- name: model_id
in: path
required: true
schema:
type: string
description: The ID of the model (e.g., gpt-4o)
responses:
'200':
description: Model details
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
components:
schemas:
ChatCompletionRequest:
type: object
required: [model, messages]
properties:
model:
type: string
description: Model ID (e.g., gpt-4o, gpt-4o-mini)
messages:
type: array
items:
$ref: '#/components/schemas/ChatMessage'
temperature:
type: number
minimum: 0
maximum: 2
default: 1
max_tokens:
type: integer
nullable: true
stream:
type: boolean
default: false
tools:
type: array
items:
$ref: '#/components/schemas/Tool'
tool_choice:
oneOf:
- type: string
enum: [none, auto, required]
- $ref: '#/components/schemas/ToolChoice'
ChatMessage:
type: object
required: [role, content]
properties:
role:
type: string
enum: [system, user, assistant, tool]
content:
oneOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ContentPart'
name:
type: string
tool_calls:
type: array
items:
$ref: '#/components/schemas/ToolCall'
tool_call_id:
type: string
ContentPart:
oneOf:
- type: object
required: [type, text]
properties:
type:
type: string
const: text
text:
type: string
- type: object
required: [type, image_url]
properties:
type:
type: string
const: image_url
image_url:
type: object
required: [url]
properties:
url:
type: string
format: uri
detail:
type: string
enum: [auto, low, high]
ChatCompletionResponse:
type: object
properties:
id:
type: string
object:
type: string
const: chat.completion
created:
type: integer
model:
type: string
choices:
type: array
items:
type: object
properties:
index:
type: integer
message:
$ref: '#/components/schemas/ChatMessage'
finish_reason:
type: string
enum: [stop, length, tool_calls, content_filter]
usage:
$ref: '#/components/schemas/Usage'
ChatCompletionChunk:
type: object
properties:
id:
type: string
object:
type: string
const: chat.completion.chunk
created:
type: integer
model:
type: string
choices:
type: array
items:
type: object
properties:
index:
type: integer
delta:
type: object
properties:
role:
type: string
content:
type: string
nullable: true
tool_calls:
type: array
items:
$ref: '#/components/schemas/ToolCallDelta'
finish_reason:
type: string
nullable: true
enum: [stop, length, tool_calls, content_filter]
Usage:
type: object
properties:
prompt_tokens:
type: integer
completion_tokens:
type: integer
total_tokens:
type: integer
Tool:
type: object
required: [type, function]
properties:
type:
type: string
const: function
function:
type: object
required: [name]
properties:
name:
type: string
description:
type: string
parameters:
type: object
ToolChoice:
type: object
required: [type, function]
properties:
type:
type: string
const: function
function:
type: object
required: [name]
properties:
name:
type: string
ToolCall:
type: object
properties:
id:
type: string
type:
type: string
const: function
function:
type: object
properties:
name:
type: string
arguments:
type: string
ToolCallDelta:
type: object
properties:
index:
type: integer
id:
type: string
type:
type: string
function:
type: object
properties:
name:
type: string
arguments:
type: string
EmbeddingRequest:
type: object
required: [model, input]
properties:
model:
type: string
input:
oneOf:
- type: string
- type: array
items:
type: string
encoding_format:
type: string
enum: [float, base64]
default: float
dimensions:
type: integer
EmbeddingResponse:
type: object
properties:
object:
type: string
const: list
data:
type: array
items:
type: object
properties:
object:
type: string
const: embedding
index:
type: integer
embedding:
type: array
items:
type: number
model:
type: string
usage:
type: object
properties:
prompt_tokens:
type: integer
total_tokens:
type: integer
Model:
type: object
properties:
id:
type: string
object:
type: string
const: model
created:
type: integer
owned_by:
type: string
ModelList:
type: object
properties:
object:
type: string
const: list
data:
type: array
items:
$ref: '#/components/schemas/Model'
APIError:
type: object
required: [error]
properties:
error:
type: object
required: [message, type]
properties:
message:
type: string
type:
type: string
param:
type: string
nullable: true
code:
type: string
nullable: true
responses:
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
Unauthorized:
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
RateLimited:
description: Rate limit exceeded
headers:
retry-after:
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: |
OpenAI API key as Bearer token.
Get your key at: https://platform.openai.com/api-keys
externalDocs:
description: OpenAI API Reference
url: https://platform.openai.com/docs/api-referenceGenerated OAS 3.2.0 spec for {Provider} API:
- Endpoints: {count}
- Schemas: {count}
- Auth: {method(s)}
- Streaming: {yes/no}
- File: {path}