PhoenixLLM
Buy LLM Token
POST https://www.phoenix.global/sdk/computation/LLM/buyLLMToken
Headers
token*
string
The token generated in the previous step
Request Body
tokensNum*
integer
The number of tokens to be purchased
jobName*
string
Job name
{
"code": 200,
"msg": "success",
"jobID": "15336929879565052031766977071313450079096374296015479727460579121350576553341"
}The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/buyLLMToken' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"tokensNum": 1000,
"jobName": "LLM job"
}'package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqJSON := common.ReqBuyLlmToken{
UserToken: tokenStr,
JobName: "Buy llm token 31",
TokensNum: 1000,
}
result, err := controllers.BuyLLMToken(reqJSON)
...
}Query Token price
GET https://www.phoenix.global/sdk/computation/LLM/queryLLMPrice
Querying the price of LLM token, priced in ccd
Headers
token*
string
The token generated in the previous step
{
"code": 200,
"data": {
"price": "0.000007142857"
},
"msg": "success"
}The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/queryLLMPrice' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs'package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
result, err := controllers.QueryLLMPrice(tokenStr)
...
}Default LLM
POST https://www.phoenix.global/sdk/computation/LLM/callLLM3
Headers
token*
string
The token generated in the previous step
Request Body
prompt*
string
Prompt
max_new_tokens
int
The maximum number of tokens that can be consumed by this call
Response
{
"code": 200,
"msg": "success",
"text": "Blockchain is a distributed digital ledger technology...",
"tokens_balance": 1534425
}The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/callLLM3' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "what is blockchain"
}'package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqJSON := common.ReqLLM3{
UserToken: tokenStr,
Prompt: "what is blockchain",
}
result, err := controllers.CallLLM3(reqJSON)
...
}
Coding LLM
POST https://www.phoenix.global/sdk/computation/LLM/verticalLLM
Headers
token*
string
The token generated in the previous step
Request Body
prompt*
string
Prompt
max_new_tokens
int
The maximum number of tokens that can be consumed by this call
Response
{
"code": 200,
"msg": "success",
"text": "Certainly! Below is an example of a simple Solidity smart contract that creates a basic token...",
"tokens_balance": 1534425
}The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/verticalLLM' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Write a simple solidity contract"
}'package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqJSON := common.ReqLLM3{
UserToken: tokenStr,
Prompt: "Write a simple solidity contract",
}
result, err := controllers.VerticalLLM(reqJSON)
...
}Last updated