gateway: an Ark image request's own fields go to Ark, and watermark and response_format are the caller's
axelburks on Discord listed what /v1/images/generations did to a Seedream
request against Ark's images API (docs 82379/1541523). Checked against
those docs and draw.go / draw_volcengine.go; the real ones:
- Image params were dropped. drawing read OpenAI's fields alone, so
sequential_image_generation and its options (a group of up to 15),
optimize_prompt_options, tools, layer_decomposition and every other
Ark field never reached Ark. Now the request's fields magpie doesn't
read (drawingRead) are drawing.Extra, from a JSON body or a multipart
form, masked as the prompt is (fails closed), and sent to Ark as they
came; a form's values are typed as Ark takes them (formValue, with
Ark's text fields kept as text). layer_decomposition with an image
needs no prompt.
- watermark and response_format were forced. Every request went with
watermark false and response_format b64_json. Now watermark false is
magpie's default only, and a caller's watermark wins; response_format
"url" asks Ark for its URL and answers it, anything else still asks
b64_json.
- stream true would have gone to Ark and come back as events this route
can't read: it is a 400 that names
/v1/magpie/native/<provider>/images/generations.
Kept as it was: n stays OpenAI's, that many requests, each one image or
one group.
Tests: TestArkImagesPassOnTheirOwnFields (a group, optimize_prompt_options,
a caller's watermark, tools and url reach Ark as sent; a form's fields
typed; stream refused naming the native route). Docs: gateway-routing.md
(the Ark images row and paragraph), docs/integrating.md and the site's
integrate page (en, zh) on the vendor fields and the native route.
Run on mote at the head of this stack (the Ark video fields, the native
route and the Ark image fields, three commits on af9ac3d25):
- go test -count=1 -timeout 45m ./internal/gateway ./internal/gui
./internal/access: gateway and access ok; gui red only in
TestMainWindowCorners/macOS_26_SDK (#3949, red on main).
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./...: clean. gofmt -l: nothing.
- No GUI file or script changes in this stack, so no GUI run.
The commits between were not run on their own at this base.
Broken by hand, each red, then put back:
- Extra not merged into Ark's request: TestArkImagesPassOnTheirOwnFields red
- response_format url not asked of Ark: TestArkImagesPassOnTheirOwnFields red
Not tried: no real Ark image was drawn (no money spent); the shapes are
from Ark's docs, on a fake Ark.
Credit: axelburks on Discord.
This commit is contained in:
@@ -66,6 +66,19 @@ with `?kind=image,video` (or `?kind=chat,image,video`, or `?kind=all`).
|
||||
Each of them is marked `"kind": "image"` or `"kind": "video"` and goes to
|
||||
`/v1/images/generations` or `/v1/videos`, never to a chat route.
|
||||
|
||||
**A vendor's own fields.** `/v1/images/generations` and `/v1/videos`
|
||||
take OpenAI's fields and pass the others on to a vendor that takes them:
|
||||
Volcengine Ark's `content` (reference video and audio, `draft_task`),
|
||||
`ratio`, `resolution`, `duration: -1`, `tools`, `watermark`,
|
||||
`sequential_image_generation` and the rest. A video's answer carries
|
||||
Ark's own fields too (`content.last_frame_url`, `usage`, `resolution`).
|
||||
For the rest of Ark's API (an image stream, the task list, cancelling a
|
||||
task) use `/v1/magpie/native/<provider>/<path>`: `POST
|
||||
images/generations`, `POST` or `GET contents/generations/tasks`, `GET` or
|
||||
`DELETE contents/generations/tasks/<id>`, sent and answered in Ark's own
|
||||
shape on the user's Ark key. It takes the same gateway key as every route,
|
||||
and a key held to models, accounts or a budget is refused it.
|
||||
|
||||
**Optional.** Send `X-Magpie-Session: <id>` with a conversation's requests
|
||||
and `GET /v1/magpie/route?session=<id>` says which model a routing group
|
||||
picked for the turn and the fallbacks it tried, before the first token
|
||||
|
||||
@@ -704,7 +704,7 @@ Each vendor is sent its own request:
|
||||
| OpenAI-compatible images API (gpt-image, dall-e, a relay) | JSON `/images/generations` | multipart `/images/edits`, mask included; a URL image is downloaded first | at `<base>/videos` only when its list or the user marks a video model (below) |
|
||||
| ChatGPT account (Codex backend), SenseNova U1 | JSON | JSON `images: [{"image_url"}]`, `mask: {"image_url"}` | none |
|
||||
| Grok subscription | JSON with `aspect_ratio` | JSON `/images/edits`, `images: [{"url"}]` | `/videos/generations`: `duration`, `aspect_ratio`, `resolution`, `image`, `reference_images` |
|
||||
| Volcengine Ark (`isArk`) | `/images/generations`, `watermark: false`, one request per image, ratio as the doc's 2K size | the same endpoint, images as JSON `image` (URL or data URL); a mask is a 400 that says to describe it in the prompt | Seedance at `/contents/generations/tasks` (below) |
|
||||
| Volcengine Ark (`isArk`) | `/images/generations`, `watermark: false` unless sent, one request per image, ratio as the doc's 2K size, the caller's other fields as sent (`stream: true` is a 400 pointing to the native route) | the same endpoint, images as JSON `image` (URL or data URL); a mask is a 400 that says to describe it in the prompt | Seedance at `/contents/generations/tasks` (below) |
|
||||
| Gemini at Google, a Google sign-in | `generateContent` asking for images | the images as inline parts | a plugin's Veo through its fetch |
|
||||
| OpenRouter | `/images` for image-only models, chat with modalities for the others | `input_references` | none |
|
||||
| DashScope, ModelScope | their own asynchronous image APIs (`draw_dashscope.go`, `draw_modelscope.go`) | their image fields | none |
|
||||
@@ -783,6 +783,15 @@ that URL (`vendorClient`) and serves a MOV as `video/quicktime`
|
||||
`TestOnlyArkTakesItsOwnVideoAsks`, `TestArkVideoSize`,
|
||||
`TestArkVideoAnswersItsOwnFields`, `TestVideoType`.
|
||||
|
||||
Ark's images get the same: the request's fields magpie doesn't read
|
||||
(`drawingRead`) are `drawing.Extra`, masked as the prompt is and sent to
|
||||
Ark as they came (`sequential_image_generation` and its options for a
|
||||
group of images, `optimize_prompt_options`, `tools`,
|
||||
`layer_decomposition`, which needs no prompt, and `watermark` over
|
||||
magpie's `false`). `n` stays OpenAI's: that many requests, each one image
|
||||
or one group. `response_format: "url"` asks Ark for its URL and answers
|
||||
it; anything else asks for `b64_json`. `TestArkImagesPassOnTheirOwnFields`.
|
||||
|
||||
#### The native route
|
||||
|
||||
`/v1/magpie/native/{provider}/{path...}` ([`native.go`](../../internal/gateway/native.go))
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package gateway
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"mime/multipart"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Ark's images fields go as they came: a group with
|
||||
// sequential_image_generation, optimize_prompt_options, a watermark the
|
||||
// caller asks for, and an answer as Ark's URL when the caller asks for url.
|
||||
func TestArkImagesPassOnTheirOwnFields(t *testing.T) {
|
||||
s, a := arked(t)
|
||||
body := `{"model":"ark/doubao-seedream-4-5-251128","prompt":"四季","sequential_image_generation":"auto","sequential_image_generation_options":{"max_images":4},
|
||||
"optimize_prompt_options":{"mode":"fast"},"watermark":true,"tools":[{"type":"web_search"}],"response_format":"url"}`
|
||||
if code, _, raw := postImages(t, s, "/v1/images/generations", "application/json", body); code != 200 {
|
||||
t.Fatalf("%d %s", code, raw)
|
||||
}
|
||||
m := a.sent(t)[0]
|
||||
opts, _ := m["sequential_image_generation_options"].(map[string]any)
|
||||
opt, _ := m["optimize_prompt_options"].(map[string]any)
|
||||
tools, _ := m["tools"].([]any)
|
||||
if m["sequential_image_generation"] != "auto" || opts["max_images"] != float64(4) || opt["mode"] != "fast" || m["watermark"] != true ||
|
||||
len(tools) != 1 || m["response_format"] != "url" {
|
||||
t.Fatalf("sent %v", m)
|
||||
}
|
||||
|
||||
// a form's fields are typed as Ark takes them
|
||||
var buf bytes.Buffer
|
||||
mw := multipart.NewWriter(&buf)
|
||||
mw.WriteField("model", "ark/doubao-seedream-4-5-251128")
|
||||
mw.WriteField("prompt", "四季")
|
||||
mw.WriteField("watermark", "true")
|
||||
mw.WriteField("sequential_image_generation", "auto")
|
||||
mw.Close()
|
||||
if code, _, raw := postImages(t, s, "/v1/images/generations", mw.FormDataContentType(), buf.String()); code != 200 {
|
||||
t.Fatalf("%d %s", code, raw)
|
||||
}
|
||||
if m := a.sent(t)[1]; m["watermark"] != true || m["sequential_image_generation"] != "auto" {
|
||||
t.Fatalf("sent %v", m)
|
||||
}
|
||||
|
||||
// a stream is Ark's events, which this route doesn't give
|
||||
code, _, raw := postImages(t, s, "/v1/images/generations", "application/json", `{"model":"ark/doubao-seedream-4-5-251128","prompt":"四季","stream":true}`)
|
||||
if code != 400 || !strings.Contains(raw, NativePath) {
|
||||
t.Fatalf("%d %s", code, raw)
|
||||
}
|
||||
}
|
||||
@@ -504,6 +504,27 @@ type drawing struct {
|
||||
N int
|
||||
Images []picture // to edit, or draw from
|
||||
Mask *picture
|
||||
// Extra are the request's fields magpie doesn't read, which a
|
||||
// vendor's own images API that takes them is sent as they came
|
||||
// (Ark's sequential_image_generation, optimize_prompt_options,
|
||||
// watermark…; drawingRead). Form: they came in a multipart form, as
|
||||
// text.
|
||||
Extra map[string]any
|
||||
Form bool
|
||||
}
|
||||
|
||||
// drawingRead are the fields of an images request magpie reads itself.
|
||||
var drawingRead = []string{"model", "prompt", "size", "quality", "background", "output_format", "response_format", "n", "image", "image[]", "images", "mask", "user"}
|
||||
|
||||
// extraOf keeps v as one of d's Extra under k, unless magpie reads k.
|
||||
func (d *drawing) extraOf(k string, v any) {
|
||||
if slices.Contains(drawingRead, k) {
|
||||
return
|
||||
}
|
||||
if d.Extra == nil {
|
||||
d.Extra = map[string]any{}
|
||||
}
|
||||
d.Extra[k] = v
|
||||
}
|
||||
|
||||
// drawn is what a vendor gave back.
|
||||
@@ -610,6 +631,13 @@ func (s *Server) images(edit bool) http.HandlerFunc {
|
||||
var hits maskHits
|
||||
w, d.Prompt, unmask, hits, err = redactedPromptHits(r.Context(), w, d.Prompt)
|
||||
defer unmask()
|
||||
// the fields passed on as they came are masked as the prompt is,
|
||||
// as a video's are
|
||||
if err == nil {
|
||||
var extra maskHits
|
||||
err = maskStrings(r.Context(), d.Extra, &extra)
|
||||
hits.add(extra)
|
||||
}
|
||||
if err != nil {
|
||||
fail(maskStatus(err), err.Error())
|
||||
return
|
||||
@@ -801,6 +829,10 @@ func readDrawing(r *http.Request) (drawing, error) {
|
||||
}
|
||||
d.Model, d.Prompt, d.Size, d.Quality, d.Background, d.Format, d.Want = get("model"), get("prompt"), get("size"), get("quality"), get("background"), get("output_format"), get("response_format")
|
||||
d.N, _ = strconv.Atoi(get("n"))
|
||||
d.Form = true
|
||||
for k := range f.Value {
|
||||
d.extraOf(k, get(k))
|
||||
}
|
||||
for _, k := range []string{"image", "image[]"} {
|
||||
for _, fh := range f.File[k] {
|
||||
pic, err := readPart(fh)
|
||||
@@ -839,6 +871,11 @@ func readDrawing(r *http.Request) (drawing, error) {
|
||||
return d, fmt.Errorf("the request isn't JSON: %v", err)
|
||||
}
|
||||
d = drawing{Model: in.Model, Prompt: in.Prompt, Size: in.Size, Quality: in.Quality, Background: in.Background, Format: in.Format, Want: strings.TrimSpace(in.ResponseFormat), N: in.N}
|
||||
var all map[string]any
|
||||
json.Unmarshal(body, &all)
|
||||
for k, v := range all {
|
||||
d.extraOf(k, v)
|
||||
}
|
||||
for _, raw := range []json.RawMessage{in.Image, in.Images} {
|
||||
for _, src := range imageSources(raw) {
|
||||
pic, err := pictureOf(src)
|
||||
@@ -857,7 +894,9 @@ func readDrawing(r *http.Request) (drawing, error) {
|
||||
}
|
||||
}
|
||||
d.Model = strings.TrimSpace(d.Model)
|
||||
if strings.TrimSpace(d.Prompt) == "" {
|
||||
// Ark's layer_decomposition splits the image it is given into layers,
|
||||
// and takes no prompt
|
||||
if strings.TrimSpace(d.Prompt) == "" && (d.Extra["layer_decomposition"] == nil || len(d.Images) == 0) {
|
||||
return d, errors.New("say what to draw in prompt")
|
||||
}
|
||||
if d.N <= 0 {
|
||||
|
||||
@@ -9,16 +9,20 @@ package gateway
|
||||
// - reference images go in the same JSON body, as image (a string, or an
|
||||
// array for several), each a URL or a data:image/<fmt>;base64 URL; there
|
||||
// is no edits endpoint and no multipart;
|
||||
// - there is no n: a request draws one image (or a group the model sizes
|
||||
// itself, which magpie doesn't ask for);
|
||||
// - there is no n: a request draws one image, or a group of up to 15
|
||||
// with sequential_image_generation "auto" (Seedream 4.x, 5.0 lite);
|
||||
// - size is a tier ("1K", "2K", "4K"…) or WIDTHxHEIGHT, never a ratio:
|
||||
// the doc says to give a ratio in the prompt, and lists the WxH each
|
||||
// ratio maps to at 2K;
|
||||
// - there is no quality and no mask.
|
||||
//
|
||||
// So magpie draws there as the doc says: watermark false, the images as
|
||||
// JSON, one request per image asked for, and a ratio sent as the doc's 2K
|
||||
// size for it, or turned away with what to do instead (JL on Discord).
|
||||
// So magpie draws there as the doc says: watermark false unless the caller
|
||||
// sends its own, the images as JSON, one request per image n asks for (each
|
||||
// a group when the caller sends sequential_image_generation), and a ratio
|
||||
// sent as the doc's 2K size for it, or turned away with what to do instead
|
||||
// (JL on Discord). The caller's other fields of Ark's own go as they came,
|
||||
// and response_format url is asked of Ark as url, its link answered
|
||||
// (axelburks on Discord); stream is turned away, its events being Ark's.
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -68,7 +72,11 @@ func arkSize(size string) (string, error) {
|
||||
return size, nil
|
||||
}
|
||||
|
||||
// arkBody is d as Ark's images API takes it, for one image.
|
||||
// arkImageTextFields are Ark's images fields that are text, kept as text
|
||||
// from a multipart form.
|
||||
var arkImageTextFields = []string{"model", "prompt", "size", "sequential_image_generation", "output_format", "background", "response_format"}
|
||||
|
||||
// arkBody is d as Ark's images API takes it, for one request.
|
||||
func arkBody(model string, d drawing) ([]byte, error) {
|
||||
if d.Mask != nil {
|
||||
return nil, errors.New("Volcengine's images API takes no mask: say in the prompt which part of the image to change")
|
||||
@@ -77,7 +85,30 @@ func arkBody(model string, d drawing) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req := map[string]any{"model": model, "prompt": d.Prompt, "watermark": false, "response_format": "b64_json"}
|
||||
// the caller's own fields of Ark's first (watermark,
|
||||
// sequential_image_generation and its options, optimize_prompt_options,
|
||||
// tools, layer_decomposition…; axelburks on Discord), then what magpie
|
||||
// reads of OpenAI's: a watermark is off unless the caller asks for
|
||||
// one, and the image comes as Ark's URL when the caller asks for url
|
||||
req := map[string]any{"watermark": false}
|
||||
for k, v := range d.Extra {
|
||||
if d.Form {
|
||||
v = formValue(k, v, arkImageTextFields)
|
||||
}
|
||||
req[k] = v
|
||||
}
|
||||
if on, _ := req["stream"].(bool); on {
|
||||
return nil, errors.New("Volcengine's images API streams its images in events of its own, which /v1/images/generations doesn't give: leave stream out, or ask Ark's own API through magpie at /v1/magpie/native/<provider>/images/generations")
|
||||
}
|
||||
delete(req, "stream")
|
||||
req["model"] = model
|
||||
if d.Prompt != "" {
|
||||
req["prompt"] = d.Prompt
|
||||
}
|
||||
req["response_format"] = "b64_json"
|
||||
if strings.EqualFold(d.Want, "url") {
|
||||
req["response_format"] = "url"
|
||||
}
|
||||
if size != "" {
|
||||
req["size"] = size
|
||||
}
|
||||
|
||||
@@ -122,6 +122,8 @@ curl -s http://127.0.0.1:3425/v1/models -H "Authorization: Bearer magpie-acme"</
|
||||
<h3>Models</h3>
|
||||
<p><code>GET /v1/models</code> lists what the user has turned on: <code>id</code> (<code>provider/model</code>, or a routing group’s name, sent as it is), <code>display_name</code>, <code>owned_by</code> (the provider), <code>reasoning</code> and <code>supported_reasoning_levels</code> (<code>[{"effort":"low"},…]</code>, and the same as plain names in <code>reasoning_levels</code>), <code>context_window</code> and <code>max_output_tokens</code> when known, and <code>modalities</code> when magpie knows whether it takes images. List them from there rather than shipping a list: the user adds and removes providers in magpie. Reasoning is asked in your API’s own field (<code>reasoning_effort</code>, <code>reasoning.effort</code>, Anthropic’s <code>thinking</code> or <code>output_config.effort</code>). <code>?format=text</code> gives the ids one a line. The list holds chat models alone: ask for image and video models with <code>?kind=image,video</code> (or <code>?kind=all</code>). Each is marked <code>"kind": "image"</code> or <code>"video"</code> and is made on <code>/v1/images/generations</code> or <code>/v1/videos</code>, not a chat route.</p>
|
||||
|
||||
<p>A vendor’s own fields: <code>/v1/images/generations</code> and <code>/v1/videos</code> take OpenAI’s fields and pass the others on to a vendor that takes them, such as Volcengine Ark’s <code>content</code> (reference video and audio, <code>draft_task</code>), <code>ratio</code>, <code>resolution</code>, <code>duration: -1</code>, <code>tools</code>, <code>watermark</code> and <code>sequential_image_generation</code>, and a video’s answer carries Ark’s own fields (<code>content.last_frame_url</code>, <code>usage</code>). For the rest of Ark’s API (an image stream, the task list, cancelling a task) use <code>/v1/magpie/native/<provider>/<path></code>: <code>POST images/generations</code>, <code>POST</code> or <code>GET contents/generations/tasks</code>, <code>GET</code> or <code>DELETE contents/generations/tasks/<id></code>, in Ark’s own shape on the user’s Ark key. It takes the same gateway key as every route, and a key held to models, accounts or a budget is refused it.</p>
|
||||
|
||||
<h3>Optional</h3>
|
||||
<p>Send <code>X-Magpie-Session: <id></code> with a conversation’s requests and <code>GET /v1/magpie/route?session=<id></code> says which model a routing group picked for the turn and the fallbacks it tried, before the first token (long-poll with <code>after=<seq>&wait=<s></code>). <code>GET /v1/magpie/quotas</code> lists the user’s subscription allowances, and <code>GET /v1/magpie/usage</code> and <code>/v1/magpie/usage/requests</code> the Usage page’s numbers and its requests (with <code>session</code>, and <code>subagent</code>/<code>parent_agent</code> for a Claude Code subagent’s call). They answer only this machine, or another with a gateway key; a key held to a budget, models or accounts sees its own calls and routes alone, and is refused the quotas unless its owner lets it see those of what it may use (<code>magpie gateway-key quotas <id> on</code>; its own limit is <code>GET /v1/magpie/limit</code>). Calls your app makes to its vendor itself can be reported with <code>POST /v1/magpie/usage/requests</code> (one record or up to 5000 a post, in <code>usage.jsonl</code>’s shape, each with a <code>rid</code>; past times are kept, so a history can be backfilled). They show on the Usage page as reported, and never count against a key’s limit. The <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#connecting-anything-else">reference</a> has the details.</p>
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@ curl -s http://127.0.0.1:3425/v1/models -H "Authorization: Bearer magpie-acme"</
|
||||
<h3>模型</h3>
|
||||
<p><code>GET /v1/models</code> 列出用户打开的模型:<code>id</code>(<code>provider/model</code>,或路由组的名字,原样发送即可)、<code>display_name</code>、<code>owned_by</code>(供应商)、<code>reasoning</code> 与 <code>supported_reasoning_levels</code>(<code>[{"effort":"low"},…]</code>;同样的档位以纯名字列在 <code>reasoning_levels</code>),已知时还有 <code>context_window</code>、<code>max_output_tokens</code>,以及 magpie 知道是否支持图片时的 <code>modalities</code>。请从这里读取,而不是内置一份列表:用户会在 magpie 里增删供应商。推理强度用你所用 API 自己的字段传(<code>reasoning_effort</code>、<code>reasoning.effort</code>、Anthropic 的 <code>thinking</code> 或 <code>output_config.effort</code>)。<code>?format=text</code> 每行一个 id。列表只有对话模型:要图像和视频模型,请加 <code>?kind=image,video</code>(或 <code>?kind=all</code>),它们带 <code>"kind": "image"</code> 或 <code>"video"</code>,在 <code>/v1/images/generations</code> 或 <code>/v1/videos</code> 上生成,不走对话接口。</p>
|
||||
|
||||
<p>厂商自己的字段:<code>/v1/images/generations</code> 和 <code>/v1/videos</code> 读 OpenAI 的字段,其余字段原样转给支持它们的厂商,比如火山方舟的 <code>content</code>(参考视频、参考音频、<code>draft_task</code>)、<code>ratio</code>、<code>resolution</code>、<code>duration: -1</code>、<code>tools</code>、<code>watermark</code>、<code>sequential_image_generation</code>;视频的回答也带上方舟自己的字段(<code>content.last_frame_url</code>、<code>usage</code>)。方舟 API 的其他部分(图片流式输出、任务列表、取消任务)请用 <code>/v1/magpie/native/<provider>/<path></code>:<code>POST images/generations</code>,<code>POST</code> 或 <code>GET contents/generations/tasks</code>,<code>GET</code> 或 <code>DELETE contents/generations/tasks/<id></code>,按方舟自己的格式收发,用的是用户的方舟密钥。它和其他接口一样需要网关密钥;限了模型、账号或额度的密钥不能用它。</p>
|
||||
|
||||
<h3>可选</h3>
|
||||
<p>在同一会话的请求里带上 <code>X-Magpie-Session: <id></code>,<code>GET /v1/magpie/route?session=<id></code> 就能在第一个 token 之前告诉你路由组为这一轮选了哪个模型、尝试过哪些后备(用 <code>after=<seq>&wait=<s></code> 长轮询)。<code>GET /v1/magpie/quotas</code> 列出用户各订阅的额度,<code>GET /v1/magpie/usage</code> 和 <code>/v1/magpie/usage/requests</code> 给出用量页的统计和逐条请求(带 <code>session</code>;Claude Code 子代理的调用还有 <code>subagent</code>/<code>parent_agent</code>)。它们只回答本机,或带网关密钥的其他机器;限了额度、模型或账号的密钥只看得到自己的调用和路由,额度不告诉它,除非它的主人允许它看自己可用部分的额度(<code>magpie gateway-key quotas <id> on</code>;它自己的限额见 <code>GET /v1/magpie/limit</code>)。你的应用直接发给厂商、不经过 magpie 的调用,可以用 <code>POST /v1/magpie/usage/requests</code> 上报(每次一条,或最多 5000 条,格式同 <code>usage.jsonl</code> 的一行,每条带 <code>rid</code>;过去的时间照原样保留,所以可以补录历史)。它们在用量页上标为上报,且从不计入密钥的限额。细节见<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#connecting-anything-else">参考文档</a>。</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user