LogoLogo
HomeLogin
🌐 English
🌐 English
  • Little Pig Tech Docs
  • Documentations
    • What we do
    • Getting Started
      • Getting Started with Account Register
      • Little Pig Cloud Server Website Overview
    • Account Management
      • Recover Password
      • Change Password
    • Billing and Payments
      • Top-Up using USDT
      • Top-Up using Credit Card
      • Billing Info and History
    • Instance Management
      • Create Virtual Machine in AWS
      • Create Virtual Machine in GCP
      • Get Affordable VPS from Lightsail Packages
    • Domain Name
      • Purchase Domain
    • AI Platform
    • Data Plans
    • Promote to Earn Commission
    • Support
    • FAQs
Powered by GitBook

©2024 Little Pig Team. All Rights Reserved

On this page
  • Obtaining API Key
  • Configuring AI API
  • Chat Service
  • Streaming Chat Service
  • Pricing

Was this helpful?

  1. Documentations

AI Platform

Information about configuring Generative AI API.

PreviousPurchase DomainNextData Plans

Last updated 7 months ago

Was this helpful?

Obtaining API Key

Navigate to AI 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

  • Protocol: HTTPS

  • Request Method: POST

  • Request Body: Serialized JSON format

Chat Service

Invoke AI chat capabilities.

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:

// 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 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

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

API Domain:

API Endpoint:

The model pricing is subject to change. Please visit the page to view the latest pricing.

To disable API access, click on "Close Service" button in page.

https://ai.littlepig.tech
https://ai.littlepig.tech/ai/chat
configuration management
configuration management
configuration management
Testing AI chat invoke API with postman
Testing AI chat invoke API in Streaming, SSE mode with postman