Lingara Lingara 說明文件 學習指南 API 函式庫 應用程式 起造 網頁版
語言: 閩南語

取得這份文件

API 版本 2026-10-affable-towhee

get https://api.getlingara.com/v1/openapi.json

用 JSON 回傳這份 API 說明,是請求所用的 API 版本的:Lingara-Version 講明的彼个,無就是這馬的版本。毋免權杖。

權限範圍 毋免驗證身份

參數

Lingara-Versionheaderstring選填
回應這个請求所用的 API 版本。無這个的話,存取權杖會用伊的用戶端綁定的版本,無權杖的請求會用這馬的版本。猶咧開發的版本,干焦佇遮講明才用會著。毋捌的版本會回 400,代碼是 api_version_unknown。GET /v1/versions 會列出所有版本。

回應

200 OpenAPI 文件

錯誤

410application/json
回應這个請求所用的 API 版本已經停用。請佇 Lingara-Version 送一个有支援的版本,抑是共用戶端綁去別个版本。
4XXapplication/json
請求予人拒絕矣。code 講原因,error 用文字講明。
503application/json · text/plain
服務暫時無法度使用;請等 Retry-After 內底的秒數過了閣試。維護期間,內容是純文字,毋是錯誤封包。
codestring必填

請求予人拒絕的原因,是一个穩定的代碼,會當用來分支處理:比如 insufficient_scope(403)、rate_limited(429),對照用量計費的用戶端閣有 spend_cap_reached(402)佮 metered_billing_inactive(402)。

errorstring必填

範例

程式碼範例的語言

curl

curl "https://api.getlingara.com/v1/openapi.json"

TypeScript

const document = await client.getOpenApiDocument();
console.log(document.servedVersion, Object.keys(document));

Rust

let document = client.get_open_api_document().await?;
let keys: Vec<&String> = document.as_object().map(|o| o.keys().collect()).unwrap_or_default();
println!("{:?} {keys:?}", document.served_version());

Go

doc, err := client.GetOpenAPIDocument(ctx)
if err != nil {
	return err
}
fmt.Println(doc.Value["openapi"], doc.ServedVersion)

Java

import com.fasterxml.jackson.databind.JsonNode;
import com.getlingara.client.LingaraClient;

JsonNode document = client.getOpenApiDocument().body();
System.out.println(document.path("info").path("version").asText());

Kotlin

import com.getlingara.kotlin.LingaraClient
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive

val document = client.getOpenApiDocument().body
println(
    document
        .getValue("info")
        .jsonObject
        .getValue("version")
        .jsonPrimitive.content,
)

Ruby

document = client.get_open_api_document
puts "#{document.value["openapi"]} #{document.served_version}"

PHP

// Needs no token: a client built without credentials can call it.
$document = $client->getOpenApiDocument()->value;
echo $document->info->title, ' ', $document->info->version, "\n";

想欲用函式庫?請看函式庫這節。

若是翻譯佮英文參考文件無仝,就以英文參考文件為準。