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

Chat Service

Invoke AI chat capabilities.

Request Data Definition:

Parameter NameDescriptionRequiredNotes

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 NameDescriptionRequiredNotes

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:

// POST Request Body
{
  "user": "User_Input",
  "system": "System_Input",
  "secretKey": "your_secret_key_here",
  "name": "AI_Model"
}

Streaming Chat Service

Invoke AI chat capabilities (Streaming, SSE mode)

API Endpoint: https://ai.littlepig.tech/ai/chat_stream

Request Data Definition:

Parameter NameDescriptionRequiredNotes

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.

ModelPriceUnit

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

Š2024 Little Pig Team. All Rights Reserved