Good to know: All GenAI interfaces require token as a request header parameter.
Query a Task
Calling the genAI interface will return a task id, which is the unique identifier for each call. You can use the task id to query the results of the task.
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
CURL and Golang SDK
curl--location'https://www.phoenix.global/sdk/computation/genAI/genImg' \--header 'Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \--data '{ "prompt": "iron man skiing on steep slope, hd, high quality", "negative_prompt": "ugly,watermark,jpeg artifacts,error,text,username"}'
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
CURL and Golang SDK
curl--location'https://www.phoenix.global/sdk/computation/genAI/genImgSDXL' \--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \--data '{ "prompt": "iron man skiing on steep slope, hd, high quality", "negative_prompt": "ugly,watermark,jpeg artifacts,error,text,username"}'
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
CURL and Golang SDK
curl--location'https://www.phoenix.global/sdk/computation/genAI/genImgFlux' \--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \--data '{ "prompt": "iron man skiing on steep slope, hd, high quality"}'
packagemainimport ("github.com/PhoenixGlobal/Phoenix-Computation-SDK/common""github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers")funcmain() { tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqJSON :=common.ReqGenImgFlux{ UserToken: tokenStr, Prompt: "iron man skiing on steep slope, hd, high quality", } result, err := controllers.GenImgFlux(reqJSON)...}
Text to Motion
Generating a gif from prompts.
Good to know: Generating motion may take a long time. It is recommended to use WSS to obtain task results.
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}
{"code":200,"msg":"success","task_id":"40a5a249-xxxx-11ef-9ede-0618df6e77e0","token_cost":1024,//The number of tokens consumed by this request"token_balance":137542//The remaining number of tokens}