{
  "openapi": "3.1.0",
  "info": {
    "description": "Perplexity AI API - Authentication Management",
    "title": "Perplexity AI API - Authentication",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.perplexity.ai",
      "description": "Perplexity AI API"
    }
  ],
  "paths": {
    "/generate_auth_token": {
      "post": {
        "summary": "Generate Auth Token",
        "description": "Generates a new authentication token for API access.",
        "operationId": "generate_auth_token",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateAuthTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully generated authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateAuthTokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/revoke_auth_token": {
      "post": {
        "summary": "Revoke Auth Token",
        "description": "Revokes an existing authentication token.",
        "operationId": "revoke_auth_token",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeAuthTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully revoked authentication token."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    },
    "schemas": {
      "GenerateAuthTokenRequest": {
        "type": "object",
        "properties": {
          "token_name": {
            "type": "string",
            "description": "Optional name for the authentication token to help identify its purpose.",
            "example": "Production API Key"
          }
        }
      },
      "GenerateAuthTokenResponse": {
        "type": "object",
        "required": [
          "auth_token",
          "created_at_epoch_seconds"
        ],
        "properties": {
          "auth_token": {
            "type": "string",
            "description": "The newly generated authentication token. Store this securely as it cannot be retrieved again.",
            "example": "pplx-1234567890abcdef"
          },
          "created_at_epoch_seconds": {
            "type": "number",
            "description": "Unix timestamp (in seconds) of when the token was created.",
            "example": 1735689600
          },
          "token_name": {
            "type": "string",
            "description": "The name associated with this token, if provided.",
            "example": "Production API Key"
          }
        }
      },
      "RevokeAuthTokenRequest": {
        "type": "object",
        "required": [
          "auth_token"
        ],
        "properties": {
          "auth_token": {
            "type": "string",
            "description": "The authentication token to revoke.",
            "example": "pplx-1234567890abcdef"
          }
        }
      }
    }
  }
}
