-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
10503 lines (10408 loc) · 418 KB
/
Copy pathopenapi.yaml
File metadata and controls
10503 lines (10408 loc) · 418 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: BitRouter API
description: |-
The BitRouter API exposes the routing proxy and account-bound services of the hosted BitRouter Cloud node.
## Base URL
```
https://api.bitrouter.ai
```
Most endpoints are served under `/v1`. The healthcheck (`/ping`) lives at the root.
## Authentication
Routing endpoints (`/v1/chat/completions`, `/v1/messages`, `/v1/responses`, `/v1beta/models/{model_action}`) accept either:
- `x-api-key: <api-key>` — Anthropic-compatible header.
- `Authorization: Bearer <api-key | JWT>` — issued via the BitRouter console or minted from a wallet (CAIP-10 issuer).
Discovery endpoints (`/v1/models`, `/v1/providers`, `/v1/byok/encryption-pubkey`) and the healthcheck are public.
## Multi-Protocol Routing
BitRouter accepts requests in the native format of each supported provider:
- **OpenAI Chat Completions** — `/v1/chat/completions`
- **OpenAI Responses** — `/v1/responses`
- **Anthropic Messages** — `/v1/messages`
- **Google Generative Language** — `/v1beta/models/{model}:generateContent`
The router resolves the requested model to a configured upstream provider, forwards the request, and returns the response in the same provider format.
version: 1.0.0
servers:
- url: https://api.bitrouter.ai
description: Production
paths:
/ping:
get:
tags:
- Health
summary: Liveness check
description: Returns `200 OK` with an empty body if the node is up.
operationId: ping
responses:
'200':
description: Node is up.
/v1/models:
get:
tags:
- Discovery
summary: List available models
description: Returns all models available across configured providers. Supports optional query filters for provider, model ID substring, and modality.
operationId: listModels
parameters:
- in: query
name: provider
description: Filter by provider name (exact match against the model's `providers` array).
schema:
type: string
style: form
- in: query
name: id
description: Filter by model ID (case-insensitive substring match).
schema:
type: string
style: form
- in: query
name: input_modality
description: Filter by supported input modality (e.g. `text`, `image`).
schema:
type: string
style: form
- in: query
name: output_modality
description: Filter by supported output modality.
schema:
type: string
style: form
responses:
'200':
description: List of models.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ModelListResponse
description: |-
Envelope shape for `GET /v1/models`. Wraps the catalogue in `{ "data": [...] }`
so future top-level fields (pagination cursors, etc.) can be added without a
breaking change.
type: object
properties:
data:
type: array
items:
$ref: '#/$defs/ModelResponse'
required:
- data
$defs:
ContextTier:
description: |-
A higher context-pricing bracket. Some upstreams bill a model at a steeper
rate once the prompt crosses a context-length threshold (e.g. one rate up
to 128k input tokens, a higher one between 128k and 256k). The selected
bracket's rates apply to the **whole** request — a step function, not
graduated marginal brackets — and the bracket is chosen by the request's
total input (prompt) token count.
Upstreams that publish such tiers:
- Alibaba Qwen Model Studio:
<https://help.aliyun.com/en/model-studio/models>
- Google Gemini API long-context pricing:
<https://ai.google.dev/gemini-api/docs/pricing>
type: object
properties:
above_input_tokens:
description: |-
**Exclusive** lower bound on total input tokens. A request whose input
size is strictly greater than this is eligible for the bracket; a
request exactly at the bound stays in the lower bracket (so a base
bracket documented as "≤ 128k" is expressed as a tier with
`above_input_tokens: 128000`).
type: integer
format: uint64
minimum: 0
input_tokens:
$ref: '#/$defs/InputTokenPricing'
output_tokens:
$ref: '#/$defs/OutputTokenPricing'
required:
- above_input_tokens
InputTokenPricing:
description: Input token pricing per million tokens.
type: object
properties:
cache_read:
description: Cost per million cache-read input tokens.
type:
- number
- 'null'
format: double
cache_write:
description: Cost per million cache-write input tokens.
type:
- number
- 'null'
format: double
no_cache:
description: Cost per million non-cached input tokens.
type:
- number
- 'null'
format: double
ModelPricing:
description: |-
Token pricing per million tokens for a model.
`input_tokens`/`output_tokens` are the **base bracket**: the rates for the
lowest context range and the fallback when no [`context_tiers`] entry
applies. When `context_tiers` is empty the pricing is a single flat rate
for every request size (the historical behaviour).
[`context_tiers`]: ModelPricing::context_tiers
type: object
properties:
context_tiers:
description: |-
Optional higher context brackets. Empty ⇒ flat pricing. The registry
validator enforces ascending, unique `above_input_tokens` and a
complete base bracket, so the per-request resolver does not depend on
list order.
type: array
items:
$ref: '#/$defs/ContextTier'
input_tokens:
$ref: '#/$defs/InputTokenPricing'
output_tokens:
$ref: '#/$defs/OutputTokenPricing'
ModelResponse:
type: object
properties:
capabilities:
description: |-
Union of inference capabilities advertised across this model's providers
(e.g. `structured_outputs`). Omitted when empty.
type: array
items:
type: string
description:
type:
- string
- 'null'
id:
type: string
input_modalities:
type: array
items:
type: string
max_input_tokens:
type:
- integer
- 'null'
format: uint64
minimum: 0
max_output_tokens:
type:
- integer
- 'null'
format: uint64
minimum: 0
name:
type:
- string
- 'null'
output_modalities:
type: array
items:
type: string
pricing:
anyOf:
- $ref: '#/$defs/ModelPricing'
- type: 'null'
providers:
$ref: '#/$defs/ProvidersSummary'
required:
- id
- input_modalities
- output_modalities
- capabilities
- providers
OutputTokenPricing:
description: Output token pricing per million tokens.
type: object
properties:
audio:
description: Cost per million audio output tokens. Reserved — see `image`.
type:
- number
- 'null'
format: double
image:
description: |-
Cost per million image output tokens. Reserved — not yet wired
into `calculate_charge_micro_usd`.
type:
- number
- 'null'
format: double
reasoning:
description: Cost per million reasoning output tokens.
type:
- number
- 'null'
format: double
text:
description: Cost per million text output tokens.
type:
- number
- 'null'
format: double
ProvidersSummary:
type: object
properties:
total_online:
type: integer
format: uint
minimum: 0
required:
- total_online
/v1/providers:
get:
tags:
- Discovery
summary: List providers
description: Public registry of providers the node knows about, sourced from the upstream `bitrouter-providers` builtins. Used by the console to render the BYOK page without hard-coding the list.
operationId: listProviders
responses:
'200':
description: List of providers.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ProviderListResponse
description: |-
Envelope for `GET /v1/providers`. Same `{ "data": [...] }` shape as
`/v1/models` so the two listings stay consistent for SDK consumers.
type: object
properties:
data:
type: array
items:
$ref: '#/$defs/ProviderCatalogEntry'
required:
- data
$defs:
ContextTier:
description: |-
A higher context-pricing bracket. Some upstreams bill a model at a steeper
rate once the prompt crosses a context-length threshold (e.g. one rate up
to 128k input tokens, a higher one between 128k and 256k). The selected
bracket's rates apply to the **whole** request — a step function, not
graduated marginal brackets — and the bracket is chosen by the request's
total input (prompt) token count.
Upstreams that publish such tiers:
- Alibaba Qwen Model Studio:
<https://help.aliyun.com/en/model-studio/models>
- Google Gemini API long-context pricing:
<https://ai.google.dev/gemini-api/docs/pricing>
type: object
properties:
above_input_tokens:
description: |-
**Exclusive** lower bound on total input tokens. A request whose input
size is strictly greater than this is eligible for the bracket; a
request exactly at the bound stays in the lower bracket (so a base
bracket documented as "≤ 128k" is expressed as a tier with
`above_input_tokens: 128000`).
type: integer
format: uint64
minimum: 0
input_tokens:
$ref: '#/$defs/InputTokenPricing'
output_tokens:
$ref: '#/$defs/OutputTokenPricing'
required:
- above_input_tokens
InputTokenPricing:
description: Input token pricing per million tokens.
type: object
properties:
cache_read:
description: Cost per million cache-read input tokens.
type:
- number
- 'null'
format: double
cache_write:
description: Cost per million cache-write input tokens.
type:
- number
- 'null'
format: double
no_cache:
description: Cost per million non-cached input tokens.
type:
- number
- 'null'
format: double
ModelPricing:
description: |-
Token pricing per million tokens for a model.
`input_tokens`/`output_tokens` are the **base bracket**: the rates for the
lowest context range and the fallback when no [`context_tiers`] entry
applies. When `context_tiers` is empty the pricing is a single flat rate
for every request size (the historical behaviour).
[`context_tiers`]: ModelPricing::context_tiers
type: object
properties:
context_tiers:
description: |-
Optional higher context brackets. Empty ⇒ flat pricing. The registry
validator enforces ascending, unique `above_input_tokens` and a
complete base bracket, so the per-request resolver does not depend on
list order.
type: array
items:
$ref: '#/$defs/ContextTier'
input_tokens:
$ref: '#/$defs/InputTokenPricing'
output_tokens:
$ref: '#/$defs/OutputTokenPricing'
OutputTokenPricing:
description: Output token pricing per million tokens.
type: object
properties:
audio:
description: Cost per million audio output tokens. Reserved — see `image`.
type:
- number
- 'null'
format: double
image:
description: |-
Cost per million image output tokens. Reserved — not yet wired
into `calculate_charge_micro_usd`.
type:
- number
- 'null'
format: double
reasoning:
description: Cost per million reasoning output tokens.
type:
- number
- 'null'
format: double
text:
description: Cost per million text output tokens.
type:
- number
- 'null'
format: double
ProviderAggregateMetrics:
type: object
properties:
cache_hit_rate:
type: number
format: double
p50_latency_ms:
description: |-
Request-weighted average of per-model p50 latencies. Not a true
cross-bucket p50 (that would need a separate query), but cheap
and close enough for a discovery panel.
type: integer
format: uint64
minimum: 0
request_count:
type: integer
format: uint64
minimum: 0
success_rate:
description: |-
Successful responses divided by (success + provider_error +
timeout). 0.0 when no scored requests fell in the window.
type: number
format: double
required:
- request_count
- success_rate
- p50_latency_ms
- cache_hit_rate
ProviderCatalogEntry:
description: One provider as it appears to public discovery clients.
type: object
properties:
aggregate:
$ref: '#/$defs/ProviderAggregateMetrics'
byok:
description: |-
`true` when a caller may bring their own key for this provider
(registry `byok`, default true — every publicly-registerable
upstream). `false` for non-self-registerable providers (the
platform pool / aggregators), which route platform-only.
type: boolean
community:
description: |-
`true` for an unaffiliated community reseller; `false` (default) for
a first-party or official upstream.
type: boolean
id:
description: 'Stable public handle: the provider''s registry name.'
type: string
metrics_window_seconds:
type: integer
format: uint64
minimum: 0
models:
type: array
items:
$ref: '#/$defs/ProviderModelCatalogEntry'
name:
description: |-
Human-readable provider name. Always present — providers are no
longer anonymized.
type: string
rate_limit:
$ref: '#/$defs/ProviderRateLimit'
status:
$ref: '#/$defs/ProviderStatus'
required:
- id
- name
- community
- byok
- status
- rate_limit
- metrics_window_seconds
- aggregate
- models
ProviderModelCatalogEntry:
type: object
properties:
id:
description: |-
Canonical model id (e.g. `claude-sonnet-4-6`). The vendor's own
`provider_model_id` is deliberately not exposed.
type: string
metrics:
$ref: '#/$defs/ProviderModelMetrics'
pricing:
$ref: '#/$defs/ModelPricing'
required:
- id
- pricing
- metrics
ProviderModelMetrics:
type: object
properties:
p50_latency_ms:
type: integer
format: uint64
minimum: 0
request_count:
type: integer
format: uint64
minimum: 0
success_rate:
type: number
format: double
required:
- request_count
- success_rate
- p50_latency_ms
ProviderRateLimit:
type: object
properties:
current_rpm:
description: In-process sliding-window admission count for this provider.
type: integer
format: uint32
minimum: 0
declared_rpm:
description: |-
Provider-wide declared RPM from the wildcard `*` pattern in
`rate_limits`. Omitted when the provider's YAML declares no
wildcard entry — per-model overrides are intentionally not
surfaced, since the response shape is one rate per provider.
type:
- integer
- 'null'
format: uint32
minimum: 0
required:
- current_rpm
ProviderStatus:
description: Provider lifecycle state.
type: string
enum:
- active
- staging
- suspended
- withdrawn
/v1/byok/encryption-pubkey:
get:
tags:
- BYOK
summary: Get BYOK sealed-box public key
description: |-
Returns the node's current X25519 sealed-box public key plus its `kek_id` fingerprint. The console encrypts the user's provider key against this pubkey before storing the ciphertext — the node never sees plaintext on the write path.
Honors `If-None-Match: "<kek_id>"` for cheap caching, returning `304 Not Modified` when the cached fingerprint still matches.
operationId: getEncryptionPubkey
parameters:
- in: header
name: If-None-Match
description: Quoted `kek_id` from a prior response.
schema:
type: string
style: simple
responses:
'200':
description: Current sealed-box public key.
headers:
ETag:
description: Quoted `kek_id` of the returned key.
style: simple
schema:
type: string
Cache-Control:
description: '`private, max-age=300` — encourages a 5-minute client cache.'
style: simple
schema:
type: string
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: EncryptionPubkeyResponse
description: |-
Response body for `GET /v1/byok/encryption-pubkey`. Carries the current
sealed-box public key plus its fingerprint so the console can encrypt
provider keys against it.
type: object
properties:
kek_id:
description: |-
Fingerprint of the current sealed-box keypair. Pin this when caching;
pass it back via `If-None-Match` to short-circuit on `304 Not Modified`.
type: string
public_key:
description: |-
Base64-encoded X25519 public key. Use it with libsodium's `crypto_box_seal`
(or any sealed-box implementation) to encrypt provider keys client-side.
type: string
required:
- kek_id
- public_key
'304':
description: Cached `kek_id` still matches — body is empty.
/v1/namespaces:
get:
tags:
- Management
summary: List the caller's namespaces
description: |-
Every live namespace owned by the calling user, oldest first.
_Requires the `namespace:read` scope._
operationId: listNamespaces
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
'401':
description: Credential missing or did not verify.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'403':
description: Credential is valid but lacks the required scope.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'404':
description: Resource not found (or owned by a different account).
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
security:
- ApiKeyHeader: []
- BearerAuth: []
post:
tags:
- Management
summary: Create a namespace
description: |-
Creates a namespace owned by the caller. The name must be unique among the caller's live namespaces (409 on collision).
_Requires the `namespace:write` scope._
operationId: createNamespace
requestBody:
description: Request body. See the endpoint description for shape.
content:
application/json:
schema:
type: object
required: true
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
'401':
description: Credential missing or did not verify.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'403':
description: Credential is valid but lacks the required scope.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'404':
description: Resource not found (or owned by a different account).
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
security:
- ApiKeyHeader: []
- BearerAuth: []
/v1/namespaces/{nsid}:
delete:
tags:
- Management
summary: Delete a namespace and cascade its resources
description: |-
Ownership-checked. Refuses the caller's last namespace (409). Destroys the namespace's keys, OAuth tokens/clients, and policies; archives the row; detaches usage history. The wallet and BYOK keys (user-keyed) are retained.
_Requires the `namespace:write` scope._
operationId: deleteNamespace
parameters:
- in: path
name: nsid
description: Id of the target namespace. Must be owned by the caller (or equal a namespace-baked credential's own namespace), else 404.
required: true
schema:
type: string
style: simple
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
'401':
description: Credential missing or did not verify.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'403':
description: Credential is valid but lacks the required scope.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
'404':
description: Resource not found (or owned by a different account).
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'
message:
description: Human-readable error description.
type: string
required:
- message
security:
- ApiKeyHeader: []
- BearerAuth: []
/v1/account:
get:
tags:
- Management
summary: Read the caller's user profile
description: |-
Returns id, email, display_name, created_at.
_Requires the `user:read` scope._
operationId: getAccount
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
'401':
description: Credential missing or did not verify.
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
title: ErrorResponseDoc
description: |-
MIRROR: the JSON shape `bitrouter_sdk::error::BitrouterError` serialises into
(`{ "error": { "code": ..., "message": ... } }`). Cloud handlers map to
this envelope via `BitrouterError::into_response`.
type: object
properties:
error:
$ref: '#/$defs/ErrorBodyDoc'
required:
- error
$defs:
ErrorBodyDoc:
type: object
properties:
code:
description: Machine-readable error code (e.g. `unauthorized`, `bad_request`).
type:
- string
- 'null'