原生 GLiNER
获取异步 GLiNER-2 作业状态
通过 job_id 轮询 GLiNER-2 异步作业,直到其完成或失败,并附有处理中、已完成和错误响应示例。
GET
https://api.fastino.ai
/
v1
/
gliner-2
/
jobs
/
{job_id}
获取异步 GLiNER-2 作业
curl --request GET \
--url https://api.fastino.ai/v1/gliner-2/jobs/{job_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fastino.ai/v1/gliner-2/jobs/{job_id}', 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 => "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-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 := "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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("https://api.fastino.ai/v1/gliner-2/jobs/{job_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fastino.ai/v1/gliner-2/jobs/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyGET /v1/gliner-2/jobs/{job_id}
轮询 GLiNER-2 异步作业,直到其完成或失败。请使用提交该作业时所用的同一 API 密钥;作业的
作用范围限定于已认证的用户。
此页面上的 OpenAPI 面板是 job_id 路径参数和所有响应字段的事实来源。
请求示例
curl "https://api.fastino.ai/v1/gliner-2/jobs/3f08a17f-777a-4aa6-8ec5-879df37775a8" \
-H "X-API-Key: $FASTINO_API_KEY"
处理中响应
当status 为 pending 或 processing 时,请继续轮询:
{
"job_id": "3f08a17f-777a-4aa6-8ec5-879df37775a8",
"status": "pending",
"result": null,
"error": null,
"token_usage": 1284307,
"created_at": "2026-10-07T22:10:00+00:00",
"completed_at": null
}
完成响应
当status 为 complete 时停止轮询。result 遵循提交请求中的 schema:
{
"job_id": "3f08a17f-777a-4aa6-8ec5-879df37775a8",
"status": "complete",
"result": {
"entities": [
{
"text": "Apple",
"label": "organization",
"score": 0.99,
"start": 0,
"end": 5
}
]
},
"error": null,
"token_usage": 1284307,
"created_at": "2026-10-07T22:10:00+00:00",
"completed_at": "2026-10-07T22:13:42+00:00"
}
错误响应
已结束的作业可能会报告status: "error",并在 error 中附带一条消息:
{
"job_id": "3f08a17f-777a-4aa6-8ec5-879df37775a8",
"status": "error",
"result": null,
"error": "The input could not be processed",
"token_usage": 1284307,
"created_at": "2026-10-07T22:10:00+00:00",
"completed_at": "2026-10-07T22:10:08+00:00"
}
404。此页面对您有帮助吗?
⌘I
获取异步 GLiNER-2 作业
curl --request GET \
--url https://api.fastino.ai/v1/gliner-2/jobs/{job_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fastino.ai/v1/gliner-2/jobs/{job_id}', 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 => "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-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 := "https://api.fastino.ai/v1/gliner-2/jobs/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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("https://api.fastino.ai/v1/gliner-2/jobs/{job_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fastino.ai/v1/gliner-2/jobs/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body
