{
  "openapi": "3.1.0",
  "info": {
    "title": "SkillBoss API",
    "description": "Unified API gateway for 100+ AI models and services. OpenAI-compatible endpoints for seamless integration with Claude Code, Cursor, Windsurf, and autonomous AI agents.\n\n## Quick Start\n\n```bash\ncurl -fsSL https://skillboss.co/install.sh | bash\n```\n\nOr use directly:\n\n```python\nfrom openai import OpenAI\nclient = OpenAI(base_url=\"https://api.skillboss.co/v1\", api_key=\"YOUR_KEY\")\n```",
    "version": "2.0.0",
    "contact": {
      "name": "SkillBoss Support",
      "email": "support@skillboss.co",
      "url": "https://www.skillboss.co/docs"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://www.skillboss.co/legal/terms-and-conditions"
    },
    "x-logo": {
      "url": "https://www.skillboss.co/og-image.png"
    }
  },
  "servers": [
    {
      "url": "https://api.skillboss.co/v1",
      "description": "Production API"
    }
  ],
  "security": [{"BearerAuth": []}],
  "tags": [
    {
      "name": "Chat",
      "description": "Chat completion endpoints (OpenAI-compatible)"
    },
    {
      "name": "Models",
      "description": "List and retrieve available models"
    }
  ],
  "paths": {
    "/chat/completions": {
      "post": {
        "tags": ["Chat"],
        "operationId": "createChatCompletion",
        "summary": "Create chat completion",
        "description": "Create a chat completion using any of 50+ available models. Fully OpenAI-compatible - works with all OpenAI SDKs.\n\n**Supported Models:**\n- `claude-4-5-sonnet` - Best for complex reasoning\n- `gpt-5` - Latest OpenAI capabilities\n- `gemini-2.5-flash` - Fast and cost-effective\n- `deepseek/deepseek-v3` - Budget-friendly with caching\n\nSee `/models` for complete list.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              },
              "examples": {
                "basic": {
                  "summary": "Basic request",
                  "value": {
                    "model": "claude-4-5-sonnet",
                    "messages": [
                      {"role": "user", "content": "Hello!"}
                    ]
                  }
                },
                "with_system": {
                  "summary": "With system prompt",
                  "value": {
                    "model": "gpt-5",
                    "messages": [
                      {"role": "system", "content": "You are a helpful assistant."},
                      {"role": "user", "content": "What is 2+2?"}
                    ],
                    "max_tokens": 100
                  }
                },
                "streaming": {
                  "summary": "Streaming response",
                  "value": {
                    "model": "gemini-2.5-flash",
                    "messages": [
                      {"role": "user", "content": "Write a haiku about AI"}
                    ],
                    "stream": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful completion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events stream when stream=true"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" },
                "example": {
                  "error": {
                    "message": "Invalid API key. Get one at https://skillboss.co/console",
                    "type": "authentication_error",
                    "code": "invalid_api_key"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required - insufficient credits",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" },
                "example": {
                  "error": {
                    "message": "Insufficient credits. Add more at https://skillboss.co/console",
                    "type": "insufficient_credits",
                    "code": "insufficient_credits"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "schema": { "type": "integer" },
                "description": "Requests per minute allowed"
              },
              "X-RateLimit-Remaining": {
                "schema": { "type": "integer" },
                "description": "Requests remaining in current window"
              },
              "X-RateLimit-Reset": {
                "schema": { "type": "integer" },
                "description": "Unix timestamp when limit resets"
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "tags": ["Models"],
        "operationId": "listModels",
        "summary": "List available models",
        "description": "Returns a list of all available models with their capabilities and pricing information.",
        "responses": {
          "200": {
            "description": "List of models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          }
        }
      }
    },
    "/models/{model_id}": {
      "get": {
        "tags": ["Models"],
        "operationId": "getModel",
        "summary": "Get model details",
        "description": "Retrieve details about a specific model including pricing and capabilities.",
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "example": "claude-4-5-sonnet"
          }
        ],
        "responses": {
          "200": {
            "description": "Model details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Model" }
              }
            }
          },
          "404": {
            "description": "Model not found"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from https://skillboss.co/console. Include in header as: `Authorization: Bearer YOUR_API_KEY`"
      }
    },
    "schemas": {
      "ChatCompletionRequest": {
        "type": "object",
        "required": ["model", "messages"],
        "properties": {
          "model": {
            "type": "string",
            "description": "Model ID to use for completion",
            "example": "claude-4-5-sonnet",
            "enum": [
              "claude-4-5-sonnet",
              "claude-3-7-sonnet",
              "claude-3-5-haiku",
              "gpt-5",
              "gpt-4-turbo",
              "gpt-4o",
              "gpt-4o-mini",
              "gemini-2.5-flash",
              "gemini-2.0-pro",
              "deepseek/deepseek-v3",
              "qwen/qwen-max"
            ]
          },
          "messages": {
            "type": "array",
            "description": "List of messages in the conversation",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "minItems": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "Maximum tokens to generate",
            "default": 1000,
            "minimum": 1,
            "maximum": 128000
          },
          "temperature": {
            "type": "number",
            "description": "Sampling temperature (0-2)",
            "default": 1.0,
            "minimum": 0,
            "maximum": 2
          },
          "top_p": {
            "type": "number",
            "description": "Nucleus sampling parameter",
            "default": 1.0,
            "minimum": 0,
            "maximum": 1
          },
          "stream": {
            "type": "boolean",
            "description": "Enable streaming responses",
            "default": false
          },
          "stop": {
            "oneOf": [
              { "type": "string" },
              { "type": "array", "items": { "type": "string" }, "maxItems": 4 }
            ],
            "description": "Stop sequences"
          }
        }
      },
      "Message": {
        "type": "object",
        "required": ["role", "content"],
        "properties": {
          "role": {
            "type": "string",
            "enum": ["system", "user", "assistant"],
            "description": "Role of the message sender"
          },
          "content": {
            "type": "string",
            "description": "Message content"
          }
        }
      },
      "ChatCompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique completion ID",
            "example": "chatcmpl-abc123"
          },
          "object": {
            "type": "string",
            "const": "chat.completion"
          },
          "created": {
            "type": "integer",
            "description": "Unix timestamp of creation"
          },
          "model": {
            "type": "string",
            "description": "Model used for completion"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "Choice": {
        "type": "object",
        "properties": {
          "index": { "type": "integer" },
          "message": { "$ref": "#/components/schemas/Message" },
          "finish_reason": {
            "type": "string",
            "enum": ["stop", "length", "content_filter"]
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "prompt_tokens": { "type": "integer" },
          "completion_tokens": { "type": "integer" },
          "total_tokens": { "type": "integer" }
        }
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "object": { "type": "string", "const": "list" },
          "data": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Model" }
          }
        }
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "object": { "type": "string", "const": "model" },
          "created": { "type": "integer" },
          "owned_by": { "type": "string" }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": { "type": "string" },
              "type": { "type": "string" },
              "code": { "type": "string" }
            }
          }
        }
      }
    }
  },
  "x-agent-metadata": {
    "service_name": "SkillBoss",
    "total_models": 50,
    "total_services": 100,
    "compatibility": "openai",
    "supports_streaming": true,
    "supports_function_calling": true,
    "pricing_model": "pay_as_you_go",
    "free_tier_credits": 20,
    "one_line_install": "curl -fsSL https://skillboss.co/install.sh | bash",
    "capabilities": [
      "chat_completions",
      "image_generation",
      "video_generation",
      "text_to_speech",
      "speech_to_text",
      "payments",
      "email",
      "sms",
      "storage",
      "databases",
      "web_scraping"
    ],
    "supported_platforms": [
      "Claude Code",
      "Cursor",
      "Windsurf",
      "GitHub Copilot",
      "Kiro",
      "Gemini CLI",
      "Codex"
    ],
    "discovery_files": {
      "llms_txt": "/llms.txt",
      "llms_full": "/llms-full.txt",
      "agent_json": "/agent.json",
      "mcp_json": "/.well-known/mcp.json",
      "ai_plugin": "/.well-known/ai-plugin.json"
    }
  }
}
