CloudBrowserAISharp
Overview
The CloudBrowserAISharp client provides access to our /api/v1/ai
endpoint for interacting with OpenAI's API to perform various tasks.
Note: Currently, only OpenAI is supported as the AI provider. In the future, we may support other providers.
General Requirements
Headers
All requests must include an API authentication token in the header:
Common Request Body
Every request must include an openAIConfiguration
object in the body:
Where:
apiKey
: Your OpenAI API key.model
: The OpenAI model to use (e.g.,gpt-4
).
Response Format
All requests return a standard response structure:
status
: The request status (see theResponseStatus
enum).response
: The output generated by OpenAI.openAiError
(optional): Any OpenAI-specific error (see theAIError
enum).
Enums
ResponseStatus
AIError
Available Endpoints
1. query
query
Send an HTML document and a prompt to OpenAI for processing.
Request Body
Example Usage
Send an HTML document and a custom prompt for processing:
2. summarize
summarize
Generate a summary from an HTML document or text.
Request Body
Example Usage
Summarize HTML content in Spanish:
3. optimize
optimize
Optimize a given text based on specific instructions.
Request Body
Example Usage
Optimize a headline for SEO:
4. translate
translate
Translate a text into a specified language.
Request Body
Example Usage
Translate text into French:
5. describe
describe
Answer questions or describe an image provided in base64 or URL format.
Request Body
Notes
Either
base64Image
orimageUrl
must be provided, but not both.
6. ToJSON
ToJSON
Convert an HTML document into a structured JSON object.
Request Body
Example Usage
Convert HTML to JSON:
7. ToCSV
ToCSV
Convert an HTML document into a CSV file.
Request Body
Example Usage
Generate a CSV from an HTML table with custom headers:
8. ToMarkdown
ToMarkdown
Convert an HTML document into Markdown format.
Request Body
Notes
This is the only endpoint that does not require a responseFormat
.
Last updated