Token Management
Generate Token
Section titled “Generate Token”POST https://api.echovalue.dev/token
Generates a new API token. No authentication required.
Request body (application/x-www-form-urlencoded):
| Parameter | Value | Description |
|---|---|---|
token | new | Must be the literal string new |
Response: 200 — The new token as plain text.
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6curl 'https://api.echovalue.dev/token' \ -d 'token=new'fetch('https://api.echovalue.dev/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'token=new'}).then(response => response.text()).then(token => console.log(token));import requests
response = requests.post('https://api.echovalue.dev/token', data={'token': 'new'})print(response.text)<?php$ch = curl_init('https://api.echovalue.dev/token');curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, 'token=new');curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$token = curl_exec($ch);curl_close($ch);echo $token;?>package main
import ( "io" "net/http" "strings")
func main() { body := strings.NewReader("token=new") resp, _ := http.Post("https://api.echovalue.dev/token", "application/x-www-form-urlencoded", body) defer resp.Body.Close() token, _ := io.ReadAll(resp.Body) println(string(token))}Check Wallet Balance
Section titled “Check Wallet Balance”GET https://api.echovalue.dev/token
Returns remaining credits and token metadata.
Request headers:
| Header | Description |
|---|---|
x-token | Your API token |
Response: 200 — JSON object.
{ "wallet": 12345, "created": "2023-08-09T15:40:09.77Z", "hash": "a1b2c3d4e5f6..."}| Field | Type | Description |
|---|---|---|
wallet | integer | Remaining credit balance |
created | string (ISO 8601) | Date when the token was created |
hash | string | SHA256 hash of your token — use this in webhook payloads instead of the raw token |
curl 'https://api.echovalue.dev/token' \ -H 'x-token: mytoken'fetch('https://api.echovalue.dev/token', { headers: { 'x-token': 'mytoken' }}).then(response => response.json()).then(data => console.log(data));import requests
response = requests.get('https://api.echovalue.dev/token', headers={'x-token': 'mytoken'})print(response.json())<?php$ch = curl_init('https://api.echovalue.dev/token');curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-token: mytoken']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($ch);curl_close($ch);print_r(json_decode($response));?>package main
import ( "encoding/json" "io" "net/http")
func main() { req, _ := http.NewRequest("GET", "https://api.echovalue.dev/token", nil) req.Header.Set("x-token", "mytoken")
client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body) var result map[string]interface{} json.Unmarshal(body, &result) println(result)}Recharge Wallet
Section titled “Recharge Wallet”GET https://api.echovalue.dev/recharge
Returns a Stripe payment link to add credits to your wallet.
Request headers:
| Header | Description |
|---|---|
x-token | Your API token |
Query parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
amount | string | Number of million operations to add. Accepted values: 1 or 3. | 1 |
Response: 200 — Stripe payment URL as plain text.
https://buy.stripe.com/<productID>?client_reference_id=mytokencurl 'https://api.echovalue.dev/recharge?amount=1' \ -H 'x-token: mytoken'fetch('https://api.echovalue.dev/recharge?amount=1', { headers: { 'x-token': 'mytoken' }}).then(response => response.text()).then(url => window.open(url));import requests
response = requests.get('https://api.echovalue.dev/recharge', headers={'x-token': 'mytoken'}, params={'amount': '1'})print(response.text)<?php$ch = curl_init('https://api.echovalue.dev/recharge?amount=1');curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-token: mytoken']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$url = curl_exec($ch);curl_close($ch);echo $url;?>package main
import ( "fmt" "io" "net/http")
func main() { req, _ := http.NewRequest("GET", "https://api.echovalue.dev/recharge?amount=1", nil) req.Header.Set("x-token", "mytoken")
client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body))}Follow the returned URL to complete the payment.