List regions
curl --request GET \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/regions \
--header 'API-Key: <api-key>'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/regions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://dev-platform-api.trychainshift.ai/api/v1/platform/regions")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/regions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"regions": [
{
"code": "KR",
"name": "South Korea"
}
]
}{
"code": "MODEL_NOT_SUPPORTED",
"message": "Model not supported by the Platform API"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Getting started
List supported regions
프롬프트 실행 요청(submitRun)의 region 값으로 사용할 수 있는 지원 리전 목록을 조회합니다. model 을 지정하면 해당 모델이 지원하는 리전만, 생략하면 전체 리전을 반환합니다. 계약이 필요한 리전은 이 조직에 부여된 경우에만 목록에 포함됩니다.
오류
| HTTP | 코드 | 설명 |
|---|---|---|
| 400 | MODEL_NOT_SUPPORTED | 플랫폼 API 가 지원하지 않는 model 값 |
| 400 | MODEL_DISCONTINUED | 서비스가 중단된 모델을 지정함 (현재 중단된 모델은 없음) |
| 401 | COMMON_UNAUTHORIZED | API 키 또는 액세스 토큰이 없거나 유효하지 않음 |
| 402 | INSUFFICIENT_CREDITS | 조직 크레딧 잔액이 이 요청의 단가보다 적음 |
| 429 | PLATFORM_RATE_LIMIT_EXCEEDED | 요청 한도 초과. Retry-After 헤더의 초만큼 기다린 뒤 재시도 |
| 500 | — | 서버 내부 오류. code 없이 message 와 requestID 를 반환 |
GET
/
v1
/
platform
/
regions
List regions
curl --request GET \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/regions \
--header 'API-Key: <api-key>'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/regions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://dev-platform-api.trychainshift.ai/api/v1/platform/regions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://dev-platform-api.trychainshift.ai/api/v1/platform/regions")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/regions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"regions": [
{
"code": "KR",
"name": "South Korea"
}
]
}{
"code": "MODEL_NOT_SUPPORTED",
"message": "Model not supported by the Platform API"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}