{
  "openapi": "3.0.3",
  "info": {
    "title": "Answers API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.olostep.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer",
                "description": "Bearer authentication header of the form Bearer <token>, where <token> is your auth token."
      }
    }
  },
  "paths": {
    "/v1/answers": {
      "post": {
        "summary": "Create Answer",
        "description": "The AI will perform actions like searching and browsing web pages to find the answer to the provided task.\nExecution time is 3-30s depending upon complexity. \n\n For longer tasks, use the agent endpoint instead. See [Agent feature](/features/agents). See [Answers feature](/features/answers).",
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task": {
                    "type": "string",
                    "description": "The task to be performed."
                  },
                  "json_format": {
                    "type": "object",
                    "description": "The desired output JSON object with empty values as a schema, or simply describe the data you want as a string."
                  }
                },
                "required": [
                  "task"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response with the answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "created": {
                      "type": "integer"
                    },
                    "metadata": {
                      "type": "object"
                    },
                    "task": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "json_content": {
                          "type": "string"
                        },
                        "json_hosted_url": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request (Missing Task)"
          },
          "402": {
            "description": "Invalid API Key"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/answers/{answer_id}": {
      "get": {
        "summary": "Get Answer",
        "description": "This endpoint retrieves a previously completed answer by its ID.",
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "name": "answer_id",
            "in": "path",
            "required": true,
            "description": "Unique identifier for the answer to be retrieved.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the answer object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "created": {
                      "type": "integer"
                    },
                    "metadata": {
                      "type": "object"
                    },
                    "task": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "json_content": {
                          "type": "string"
                        },
                        "json_hosted_url": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Invalid API Key"
          },
          "404": {
            "description": "Answer Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  }
}