AI Platform
Information about configuring Generative AI API.
Obtaining API Key
Navigate to AI configuration management page. Click on "Open Service" button to enter configuration page.
To obtain the API key click on "View". You have to enter your account password for verification.
Configuring AI API
API Domain: https://ai.littlepig.tech
Protocol: HTTPS
Request Method: POST
Request Body: Serialized JSON format
Chat Service
Invoke AI chat capabilities.
API Endpoint: https://ai.littlepig.tech/ai/chat
Request Data Definition:
Parameter Name | Description | Required | Notes |
---|---|---|---|
user | prompt (user) | Yes | |
system | prompt (system) | No | |
secretKey | Secret key assigned to the API | Yes | |
name | Deployed model name | No | If not provided, the default is gpt_4o_mini |
Response Data Definition:
Parameter Name | Description | Required | Notes |
---|---|---|---|
code | API response code | Yes | 0000 indicates success |
message | API response message | No | |
data | Chat information | Yes | Parse the 'chat' field in the data |
Example:
Streaming Chat Service
Invoke AI chat capabilities (Streaming, SSE mode)
API Endpoint: https://ai.littlepig.tech/ai/chat_stream
Request Data Definition:
Parameter Name | Description | Required | Notes |
---|---|---|---|
user | prompt (user) | Yes | |
system | prompt (system) | No | |
secretKey | Secret key assigned to the API | Yes | |
name | Deployed model name | No | If not provided, the default is gpt_4o_mini |
Response: Streaming large model chat information
Example:
Pricing
The model pricing is subject to change. Please visit the configuration management page to view the latest pricing.
Model | Price | Unit |
---|---|---|
gpt_4o | input: $0.005 output: $0.015 | 1000time |
gpt_4o_mini | input: $0.00015 output: $0.0006 | 1000time |
gemini_15_flash | input: $0.00001875 output: $0.000075 | 1000time |
gemini_15_pro | input: $0.00125 output: $0.00375 | 1000time |
claude_3_sonnet | input: $0.003 output: $0.015 | 1000time |
To disable API access, click on "Close Service" button in configuration management page.
Last updated