{
    "openapi": "3.1.0",
    "info": {
        "title": "The Artillerist Commission Quote API",
        "version": "1.1.0",
        "description": "Paid x402 estimates for art and illustration commissions. Catalog and schemas are free.",
        "license": {
            "name": "the-artillerist-paid-machine-response-v1.0",
            "identifier": "the-artillerist-paid-machine-response-v1.0",
            "url": "https://theartillerist.com/paid-content-license"
        }
    },
    "externalDocs": {
        "description": "Human-readable API documentation",
        "url": "https://theartillerist.com/commission-quote-api"
    },
    "servers": [
        {
            "url": "https://theartillerist.com"
        }
    ],
    "paths": {
        "/api/v1/commission-quotes": {
            "post": {
                "operationId": "createCommissionQuote",
                "summary": "Create a commission quote estimate",
                "description": "Requires an x402 v2 USDC payment on Base mainnet. An unpaid request returns HTTP 402 and PAYMENT-REQUIRED.",
                "x-x402": {
                    "version": 2,
                    "network": "eip155:8453",
                    "asset": "USDC",
                    "amount": "25000",
                    "discovery": "bazaar"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QuoteInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Calculated estimate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuoteOutput"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "x402 payment required"
                    },
                    "422": {
                        "description": "Invalid quote input"
                    }
                }
            }
        },
        "/api/v1/commission-quotes/catalog.json": {
            "get": {
                "operationId": "listCommissionTypes",
                "summary": "List supported commission types",
                "responses": {
                    "200": {
                        "description": "Free catalog"
                    }
                }
            }
        },
        "/api/v1/commission-quotes/schema.json": {
            "get": {
                "operationId": "getCommissionQuoteSchema",
                "summary": "Get the free input schema",
                "responses": {
                    "200": {
                        "description": "JSON Schema"
                    }
                }
            }
        },
        "/api/v1/commission-quotes/output-schema.json": {
            "get": {
                "operationId": "getCommissionQuoteOutputSchema",
                "summary": "Get the free paid-response schema",
                "responses": {
                    "200": {
                        "description": "JSON Schema"
                    }
                }
            }
        },
        "/api/v1/commission-quotes/example.json": {
            "get": {
                "operationId": "getCommissionQuoteExample",
                "summary": "Get a free illustrative response",
                "responses": {
                    "200": {
                        "description": "Illustrative response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuoteOutput"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "QuoteInput": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                    "commission_type": {
                        "type": "string",
                        "description": "A quote_key returned by the free catalog endpoint.",
                        "pattern": "^[a-z0-9-]{2,120}$"
                    },
                    "experience": {
                        "type": "string",
                        "enum": [
                            "emerging",
                            "established",
                            "expert"
                        ],
                        "default": "established"
                    },
                    "complexity": {
                        "type": "string",
                        "enum": [
                            "simple",
                            "standard",
                            "complex"
                        ],
                        "default": "standard"
                    },
                    "finish": {
                        "type": "string",
                        "enum": [
                            "sketch",
                            "polished",
                            "rendered"
                        ],
                        "default": "polished"
                    },
                    "subjects": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "default": 1
                    },
                    "usage": {
                        "type": "string",
                        "enum": [
                            "personal",
                            "editorial",
                            "commercial_small",
                            "commercial_large",
                            "full_buyout"
                        ],
                        "default": "personal"
                    },
                    "revisions": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "default": 2
                    },
                    "rush": {
                        "type": "string",
                        "enum": [
                            "none",
                            "within_14_days",
                            "within_7_days",
                            "within_3_days"
                        ],
                        "default": "none"
                    },
                    "expenses_usd": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100000,
                        "multipleOf": 0.01,
                        "default": 0
                    }
                },
                "required": [
                    "commission_type"
                ],
                "additionalProperties": false
            },
            "QuoteOutput": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "$id": "https://theartillerist.com/api/v1/commission-quotes/output-schema.json",
                "title": "Commission Quote API paid response",
                "type": "object",
                "properties": {
                    "quote_id": {
                        "type": "string"
                    },
                    "currency": {
                        "const": "USD"
                    },
                    "commission_type": {
                        "type": "object",
                        "properties": {
                            "quote_key": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "category": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "quote_key",
                            "name",
                            "category"
                        ],
                        "additionalProperties": false
                    },
                    "estimate": {
                        "type": "object",
                        "properties": {
                            "low": {
                                "type": "number"
                            },
                            "recommended": {
                                "type": "number"
                            },
                            "high": {
                                "type": "number"
                            },
                            "confidence": {
                                "type": "string",
                                "enum": [
                                    "moderate",
                                    "broad"
                                ]
                            }
                        },
                        "required": [
                            "low",
                            "recommended",
                            "high",
                            "confidence"
                        ],
                        "additionalProperties": false
                    },
                    "breakdown": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "assumptions": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dataset": {
                        "type": "object",
                        "properties": {
                            "version": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "last_reviewed_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date"
                            },
                            "method": {
                                "type": "string"
                            },
                            "sources": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "label": {
                                            "type": "string"
                                        },
                                        "url": {
                                            "type": "string",
                                            "format": "uri"
                                        }
                                    },
                                    "required": [
                                        "label",
                                        "url"
                                    ],
                                    "additionalProperties": false
                                }
                            }
                        },
                        "required": [
                            "version",
                            "last_reviewed_at",
                            "method",
                            "sources"
                        ],
                        "additionalProperties": false
                    },
                    "inputs": {
                        "$schema": "https://json-schema.org/draft/2020-12/schema",
                        "type": "object",
                        "properties": {
                            "commission_type": {
                                "type": "string",
                                "description": "A quote_key returned by the free catalog endpoint.",
                                "pattern": "^[a-z0-9-]{2,120}$"
                            },
                            "experience": {
                                "type": "string",
                                "enum": [
                                    "emerging",
                                    "established",
                                    "expert"
                                ],
                                "default": "established"
                            },
                            "complexity": {
                                "type": "string",
                                "enum": [
                                    "simple",
                                    "standard",
                                    "complex"
                                ],
                                "default": "standard"
                            },
                            "finish": {
                                "type": "string",
                                "enum": [
                                    "sketch",
                                    "polished",
                                    "rendered"
                                ],
                                "default": "polished"
                            },
                            "subjects": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 20,
                                "default": 1
                            },
                            "usage": {
                                "type": "string",
                                "enum": [
                                    "personal",
                                    "editorial",
                                    "commercial_small",
                                    "commercial_large",
                                    "full_buyout"
                                ],
                                "default": "personal"
                            },
                            "revisions": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10,
                                "default": 2
                            },
                            "rush": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "within_14_days",
                                    "within_7_days",
                                    "within_3_days"
                                ],
                                "default": "none"
                            },
                            "expenses_usd": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100000,
                                "multipleOf": 0.01,
                                "default": 0
                            }
                        },
                        "required": [
                            "commission_type"
                        ],
                        "additionalProperties": false
                    },
                    "license": {
                        "type": "object"
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "const": "settled"
                            },
                            "amount_usdc": {
                                "type": "string",
                                "pattern": "^[0-9]+\\.[0-9]{6}$"
                            },
                            "network": {
                                "const": "eip155:8453"
                            },
                            "transaction_reference": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "status",
                            "amount_usdc",
                            "network",
                            "transaction_reference"
                        ],
                        "additionalProperties": false
                    },
                    "disclaimer": {
                        "type": "string"
                    }
                },
                "required": [
                    "quote_id",
                    "currency",
                    "commission_type",
                    "estimate",
                    "breakdown",
                    "assumptions",
                    "dataset",
                    "inputs",
                    "license",
                    "payment",
                    "disclaimer"
                ],
                "additionalProperties": false
            }
        }
    }
}
