Phoenix Computation SDK API Doc
  • Welcome
  • Quick Start
  • Reference
    • API Reference
      • Users
      • Job Operations
      • Job Queries
      • PhoenixLLM
      • PhoenixGenAI
      • Distributed AI
Powered by GitBook
On this page
  • Getting your Account
  • Making your first request
  • Generating token.

Quick Start

PreviousWelcomeNextAPI Reference

Getting your Account

Create an account at . Then you can get the api token through the registered account.

Making your first request

First, you need to use your account and password to generate a token, which can be used as the request header of other requests so that the system can determine the user's identity.

Generating token.

POST https://www.phoenix.global/sdk/computation/user/genToken

Generate a new token.

Request Body

Name
Type
Description

email*

string

Registered email address of the user

passwd*

string

Password of the registered account

{
    "code": 200,
    "msg": "success",
    "token": "eyJhbGciOiJMUzI1NiIsInP5cCI6IkpXVCJ9.eyJDbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNjYxNjh9.lrJKrtpUokcRXbE1XgZDHk5xuv4k92b4_ppY5rYpgEk"
}

Good to know: The token is valid within 60 minutes and needs to be regenerated after it expires.

Take a look at how you might call this method using our official Golang SDK v1.0.1, or via curl:

curl --location 'https://www.phoenix.global/sdk/computation/user/genToken' \
--header 'Content-Type: application/json' \
--data-raw '{
  "email": "xxxxxx@xxx.com",
  "passwd": "xxxxxxxxxxxx"
}'
// import sdk package
import (
	"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
	"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)

func main() {
	reqBody := common.ReqGenToken{
		Email:  "xxxxxx@gmail.com",
		Passwd: "xxxxxxxx",
	}
	result, err := controllers.GenToken(reqBody)
	......
}
https://computation.phoenix.global/