{
  "openapi": "3.1.0",
  "info": {
    "title": "Audiomenti API",
    "version": "1.0.0",
    "description": "Turn audio files into text. One credit transcribes up to one hour of audio; a job costs one credit per started hour of its files added together. An hour is from $1.49. Every call made with a key counts against the plan's daily request allowance (Free 1000, Plus 5000, Pro 20000, Business 50000, Studio 100000, Network 200000). Audio is stored only until it is transcribed, on a GPU rented from Replicate (US), then deleted. Transcripts stay until the job is deleted.",
    "contact": {
      "email": "contact@audiomenti.com",
      "url": "https://audiomenti.com/api"
    },
    "termsOfService": "https://audiomenti.com/terms"
  },
  "servers": [
    {
      "url": "https://audiomenti.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your key: am_ followed by 32 hex characters."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "NewFile": {
        "type": "object",
        "description": "Either a url we download, or a path with bytes that you then upload.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "A public http(s) link to the audio. Needs a key."
          },
          "path": {
            "type": "string",
            "description": "The file name, with folders if any. The transcript is named after it."
          },
          "bytes": {
            "type": "integer",
            "description": "Size of the file you will upload."
          },
          "seconds": {
            "type": "number",
            "description": "Length of the audio, if known. Otherwise estimated from size and settled when done."
          }
        }
      },
      "File": {
        "type": "object",
        "properties": {
          "n": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "uploaded",
              "running",
              "done",
              "failed"
            ]
          },
          "estimated_seconds": {
            "type": "integer"
          },
          "seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "words": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "transcript": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL of the transcript once the job is done and paid."
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "language": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "enum": [
              "txt",
              "timestamps",
              "md",
              "srt",
              "vtt",
              "json"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "files",
              "zip",
              "api"
            ]
          },
          "source_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "files_total": {
            "type": "integer"
          },
          "files_uploaded": {
            "type": "integer"
          },
          "files_done": {
            "type": "integer"
          },
          "files_failed": {
            "type": "integer"
          },
          "estimated_seconds_of_audio": {
            "type": "integer"
          },
          "seconds_of_audio": {
            "type": [
              "integer",
              "null"
            ]
          },
          "credits_quoted": {
            "type": "integer"
          },
          "credits_charged": {
            "type": "integer"
          },
          "credits_owed": {
            "type": "integer",
            "description": "Above zero when the audio ran longer than quoted and the balance did not cover it. Downloads answer 402 until paid."
          },
          "estimated_wait_seconds": {
            "type": "integer"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "started": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "description": "The job on the website."
          },
          "download": {
            "type": [
              "string",
              "null"
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/File"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/register/start": {
      "post": {
        "summary": "Email a login link",
        "description": "Sends a one-time link to the address. agree: true accepts the terms and the privacy policy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "agree"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "agree": {
                    "type": "boolean"
                  },
                  "return_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad email, or agree missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many links requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/register/confirm": {
      "post": {
        "summary": "Trade the emailed token for the key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "summary": "The account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string"
                    },
                    "plan": {
                      "type": "string"
                    },
                    "credits": {
                      "type": "integer"
                    },
                    "credits_bought": {
                      "type": "integer",
                      "description": "Of credits, how many were bought one time and never expire."
                    },
                    "allowance": {
                      "type": "integer"
                    },
                    "credits_reset_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "notify": {
                      "type": "boolean"
                    },
                    "webhook_secret": {
                      "type": "string"
                    },
                    "requests_today": {
                      "type": "integer"
                    },
                    "request_limit": {
                      "type": "integer"
                    },
                    "jobs_done": {
                      "type": "integer"
                    },
                    "seconds_transcribed": {
                      "type": "integer"
                    },
                    "recent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "delta": {
                            "type": "integer"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing_key or invalid_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Change whether we email when a job is ready",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notify": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete the account and every transcript, for good",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm"
                ],
                "properties": {
                  "confirm": {
                    "type": "string",
                    "const": "delete"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/key/rotate": {
      "post": {
        "summary": "A new key; the old one stops working at once",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pricing": {
      "get": {
        "summary": "Prices and limits; with seconds, a quote",
        "parameters": [
          {
            "name": "seconds",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Total seconds of audio to quote for."
          },
          {
            "name": "files",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/languages": {
      "get": {
        "summary": "The 25 languages, with error rates",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "summary": "Create a job",
        "description": "Up to 900 files (200 by URL), each up to 10 hours. With start: true and every file given by URL, the job is paid from credits and started in the same call.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/NewFile"
                    }
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es",
                      "fr",
                      "de",
                      "it",
                      "pt",
                      "nl",
                      "pl",
                      "ru",
                      "uk",
                      "sv",
                      "da",
                      "fi",
                      "cs",
                      "sk",
                      "ro",
                      "hu",
                      "bg",
                      "hr",
                      "el",
                      "et",
                      "lt",
                      "lv",
                      "sl",
                      "mt"
                    ],
                    "default": "en"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "txt",
                      "timestamps",
                      "md",
                      "srt",
                      "vtt",
                      "json"
                    ],
                    "default": "txt"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https. POSTed once when the job is done or failed, signed with X-Audiomenti-Signature."
                  },
                  "start": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits; the job is in the answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Your jobs, newest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "summary": "One job and its files",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Change the job's default download format",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "format"
                ],
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "txt",
                      "timestamps",
                      "md",
                      "srt",
                      "vtt",
                      "json"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Wipe the job: audio still waiting, every transcript, the job itself",
        "description": "Work that had not finished is refunded. Cannot be undone.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/files/{n}": {
      "put": {
        "summary": "Upload file n (up to 95 MB)",
        "description": "The raw bytes as the body. Content-Length must equal the bytes given when the job was created.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The file number, from 1, in the order the files were listed."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "already_uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Too large: use multipart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/files/{n}/multipart": {
      "post": {
        "summary": "Begin a multipart upload",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The file number, from 1, in the order the files were listed."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "part_size": {
                      "type": "integer"
                    },
                    "parts": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/files/{n}/parts/{part}": {
      "put": {
        "summary": "Upload one part",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The file number, from 1, in the order the files were listed."
          },
          {
            "name": "part",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "part": {
                      "type": "integer"
                    },
                    "etag": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/files/{n}/complete": {
      "post": {
        "summary": "Finish a multipart upload",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The file number, from 1, in the order the files were listed."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "parts"
                ],
                "properties": {
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "part": {
                          "type": "integer"
                        },
                        "etag": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/start": {
      "post": {
        "summary": "Pay from credits and start",
        "description": "Also pays credits_owed on a finished job that ran longer than quoted.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits; needed says how many more",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/files/{n}/transcript": {
      "get": {
        "summary": "One transcript, in any format",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The file number, from 1, in the order the files were listed."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "txt",
                "timestamps",
                "md",
                "srt",
                "vtt",
                "json"
              ]
            },
            "description": "Defaults to the job's format."
          },
          {
            "name": "inline",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Serve for reading instead of as a download."
          }
        ],
        "responses": {
          "200": {
            "description": "The transcript in the asked format"
          },
          "402": {
            "description": "credits_owed on the job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not ready yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/download": {
      "get": {
        "summary": "All transcripts",
        "description": "The single file for a one-file job; otherwise a zip with the same names and folders as what went in.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[0-9a-f]{24}$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "txt",
                "timestamps",
                "md",
                "srt",
                "vtt",
                "json"
              ]
            },
            "description": "Defaults to the job's format."
          }
        ],
        "responses": {
          "200": {
            "description": "A text file or a zip"
          },
          "402": {
            "description": "credits_owed on the job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not ready yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/checkout": {
      "post": {
        "summary": "A Stripe checkout link",
        "description": "Send one of: job (exactly what that job still needs; it starts when paid), pack (single, pack5, pack10, pack50, pack100, pack200, pack500, pack1000, pack2000, pack5000), hours (any whole number), plan (plus, pro, business, studio, network; needs a key). Open url in a browser to pay.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "job": {
                    "type": "string"
                  },
                  "pack": {
                    "type": "string"
                  },
                  "hours": {
                    "type": "integer"
                  },
                  "plan": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string",
                    "description": "Path on the site to land on afterwards."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "session_id": {
                      "type": "string"
                    },
                    "credits": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "covered, not_uploaded, already_paid or use_portal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/portal": {
      "post": {
        "summary": "A link to the Stripe billing portal",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}