@bodhiapp/ts-client 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -669,7 +669,7 @@ export interface paths {
669
669
  };
670
670
  /**
671
671
  * Get Available API Formats
672
- * @description Retrieves list of supported API formats/protocols: 'openai' (Chat Completions), 'openai_responses' (Responses API), 'anthropic' (Messages API), 'anthropic_oauth' (Anthropic via OAuth Bearer token), and 'gemini' (Google Gemini).
672
+ * @description Retrieves list of supported API formats/protocols: 'openai' (Chat Completions), 'openai_responses' (Responses API), 'anthropic' (Messages API), 'anthropic_oauth' (Anthropic via long-lived setup token), 'llm_liberty_oauth' (Anthropic via llm-liberty OAuth envelope), and 'gemini' (Google Gemini).
673
673
  */
674
674
  get: operations["getApiFormats"];
675
675
  put?: never;
@@ -1317,6 +1317,7 @@ export interface components {
1317
1317
  forward_all_with_prefix: boolean;
1318
1318
  extra_headers?: unknown;
1319
1319
  extra_body?: unknown;
1320
+ llm_liberty?: null | components["schemas"]["LlmLibertySummary"];
1320
1321
  /** Format: date-time */
1321
1322
  created_at: string;
1322
1323
  /** Format: date-time */
@@ -1326,7 +1327,7 @@ export interface components {
1326
1327
  * @description API format/protocol specification
1327
1328
  * @enum {string}
1328
1329
  */
1329
- ApiFormat: "openai" | "openai_responses" | "anthropic" | "anthropic_oauth" | "gemini";
1330
+ ApiFormat: "openai" | "openai_responses" | "anthropic" | "anthropic_oauth" | "gemini" | "llm_liberty_oauth";
1330
1331
  /**
1331
1332
  * @description Response containing available API formats
1332
1333
  * @example {
@@ -1364,6 +1365,8 @@ export interface components {
1364
1365
  });
1365
1366
  /**
1366
1367
  * @description Input request for creating or updating an API model configuration.
1368
+ * Discriminated by `api_format` — `llm_liberty_oauth` uses `LlmLibertyApiModelRequest`,
1369
+ * every other format uses `DefaultApiModelRequest`.
1367
1370
  * @example {
1368
1371
  * "api_format": "openai",
1369
1372
  * "api_key": {
@@ -1378,25 +1381,25 @@ export interface components {
1378
1381
  * "prefix": "openai"
1379
1382
  * }
1380
1383
  */
1381
- ApiModelRequest: {
1382
- /** @description API format/protocol (e.g., "openai") */
1383
- api_format: components["schemas"]["ApiFormat"];
1384
- /** @description API base URL */
1385
- base_url: string;
1386
- /** @description API key update action (Keep/Set with Some or None) */
1387
- api_key?: components["schemas"]["ApiKeyUpdate"];
1388
- /** @description List of available models */
1389
- models: string[];
1390
- /** @description Optional prefix for model namespacing (e.g., "azure/" for "azure/gpt-4") */
1391
- prefix?: string | null;
1392
- /** @description Whether to forward all requests with this prefix (true) or only selected models (false) */
1393
- forward_all_with_prefix?: boolean;
1394
- /** @description Optional extra HTTP headers to send upstream. Cannot include `Authorization`
1395
- * or `x-api-key` — those are owned by provider clients. */
1396
- extra_headers?: unknown;
1397
- /** @description Optional extra fields to merge into the request body sent upstream */
1398
- extra_body?: unknown;
1399
- };
1384
+ ApiModelRequest: (components["schemas"]["DefaultApiModelRequest"] & {
1385
+ /** @enum {string} */
1386
+ api_format: "openai";
1387
+ }) | (components["schemas"]["DefaultApiModelRequest"] & {
1388
+ /** @enum {string} */
1389
+ api_format: "openai_responses";
1390
+ }) | (components["schemas"]["DefaultApiModelRequest"] & {
1391
+ /** @enum {string} */
1392
+ api_format: "anthropic";
1393
+ }) | (components["schemas"]["DefaultApiModelRequest"] & {
1394
+ /** @enum {string} */
1395
+ api_format: "anthropic_oauth";
1396
+ }) | (components["schemas"]["DefaultApiModelRequest"] & {
1397
+ /** @enum {string} */
1398
+ api_format: "gemini";
1399
+ }) | (components["schemas"]["LlmLibertyApiModelRequest"] & {
1400
+ /** @enum {string} */
1401
+ api_format: "llm_liberty_oauth";
1402
+ });
1400
1403
  /** @description DB-storable `Vec<ApiModel>` — stored as JSON binary in SeaORM columns. */
1401
1404
  ApiModelVec: components["schemas"]["ApiModel"][];
1402
1405
  /** @enum {string} */
@@ -1711,6 +1714,51 @@ export interface components {
1711
1714
  first_name?: string | null;
1712
1715
  last_name?: string | null;
1713
1716
  };
1717
+ /** @description Inner request shape for the five non-llm-liberty `api_format` values.
1718
+ * Shared across `openai`, `openai_responses`, `anthropic`, `anthropic_oauth`, `gemini`. */
1719
+ DefaultApiModelRequest: {
1720
+ /** @description API base URL */
1721
+ base_url: string;
1722
+ /** @description API key update action (Keep/Set with Some or None) */
1723
+ api_key?: components["schemas"]["ApiKeyUpdate"];
1724
+ /** @description List of available models */
1725
+ models: string[];
1726
+ /** @description Optional prefix for model namespacing (e.g., "azure/" for "azure/gpt-4") */
1727
+ prefix?: string | null;
1728
+ /** @description Whether to forward all requests with this prefix (true) or only selected models (false) */
1729
+ forward_all_with_prefix?: boolean;
1730
+ /** @description Optional extra HTTP headers to send upstream. Cannot include `Authorization`
1731
+ * or `x-api-key` — those are owned by provider clients. */
1732
+ extra_headers?: unknown;
1733
+ /** @description Optional extra fields to merge into the request body sent upstream */
1734
+ extra_body?: unknown;
1735
+ };
1736
+ /** @description Inner request for the five non-llm-liberty `api_format` values. */
1737
+ DefaultFetchModelsRequest: {
1738
+ /** @description Credentials to use for fetching models */
1739
+ creds?: components["schemas"]["TestCreds"];
1740
+ /** @description API base URL (required - always needed to know where to fetch models from) */
1741
+ base_url: string;
1742
+ /** @description Optional extra HTTP headers. `Authorization` / `x-api-key` are forbidden. */
1743
+ extra_headers?: unknown;
1744
+ /** @description Optional extra fields to merge into the request body */
1745
+ extra_body?: unknown;
1746
+ };
1747
+ /** @description Inner request for the five non-llm-liberty `api_format` values. */
1748
+ DefaultTestPromptRequest: {
1749
+ /** @description Credentials to use for testing */
1750
+ creds?: components["schemas"]["TestCreds"];
1751
+ /** @description API base URL */
1752
+ base_url: string;
1753
+ /** @description Model to use for testing */
1754
+ model: string;
1755
+ /** @description Test prompt (max 30 characters for cost control) */
1756
+ prompt: string;
1757
+ /** @description Optional extra HTTP headers. `Authorization` / `x-api-key` are forbidden. */
1758
+ extra_headers?: unknown;
1759
+ /** @description Optional extra fields to merge into the request body */
1760
+ extra_body?: unknown;
1761
+ };
1714
1762
  /** @enum {string} */
1715
1763
  DeploymentMode: "standalone" | "multi_tenant";
1716
1764
  DownloadRequest: {
@@ -1752,7 +1800,7 @@ export interface components {
1752
1800
  max: components["schemas"]["CapabilitySupport"];
1753
1801
  };
1754
1802
  /**
1755
- * @description Request to fetch available models from provider
1803
+ * @description Request to fetch available models from provider. Discriminated on `api_format`.
1756
1804
  * @example {
1757
1805
  * "api_format": "openai",
1758
1806
  * "base_url": "http://localhost:8080/v1",
@@ -1762,18 +1810,25 @@ export interface components {
1762
1810
  * }
1763
1811
  * }
1764
1812
  */
1765
- FetchModelsRequest: {
1766
- /** @description Credentials to use for fetching models */
1767
- creds?: components["schemas"]["TestCreds"];
1768
- /** @description API base URL (required - always needed to know where to fetch models from) */
1769
- base_url: string;
1770
- /** @description API format to use for fetching models (defaults to OpenAI Chat Completions) */
1771
- api_format?: components["schemas"]["ApiFormat"];
1772
- /** @description Optional extra HTTP headers. `Authorization` / `x-api-key` are forbidden. */
1773
- extra_headers?: unknown;
1774
- /** @description Optional extra fields to merge into the request body */
1775
- extra_body?: unknown;
1776
- };
1813
+ FetchModelsRequest: (components["schemas"]["DefaultFetchModelsRequest"] & {
1814
+ /** @enum {string} */
1815
+ api_format: "openai";
1816
+ }) | (components["schemas"]["DefaultFetchModelsRequest"] & {
1817
+ /** @enum {string} */
1818
+ api_format: "openai_responses";
1819
+ }) | (components["schemas"]["DefaultFetchModelsRequest"] & {
1820
+ /** @enum {string} */
1821
+ api_format: "anthropic";
1822
+ }) | (components["schemas"]["DefaultFetchModelsRequest"] & {
1823
+ /** @enum {string} */
1824
+ api_format: "anthropic_oauth";
1825
+ }) | (components["schemas"]["DefaultFetchModelsRequest"] & {
1826
+ /** @enum {string} */
1827
+ api_format: "gemini";
1828
+ }) | (components["schemas"]["LlmLibertyFetchModelsRequest"] & {
1829
+ /** @enum {string} */
1830
+ api_format: "llm_liberty_oauth";
1831
+ });
1777
1832
  /**
1778
1833
  * @description Returns model IDs only (not full metadata) to minimize information exposure —
1779
1834
  * the endpoint accepts an API key parameter. Full metadata is stored on create/update.
@@ -1832,6 +1887,97 @@ export interface components {
1832
1887
  */
1833
1888
  page_size?: number | null;
1834
1889
  };
1890
+ LlmLibertyApiEndpoints: {
1891
+ base_url: string;
1892
+ chat_url: string;
1893
+ models_url?: string | null;
1894
+ };
1895
+ /** @description Request shape for `api_format == "llm_liberty_oauth"`. Carries the full envelope
1896
+ * (or `Keep` to leave existing credentials untouched on update). */
1897
+ LlmLibertyApiModelRequest: {
1898
+ /** @description Envelope update action — Keep (update only) or Set (create/replace credentials). */
1899
+ envelope?: components["schemas"]["LlmLibertyEnvelopeUpdate"];
1900
+ /** @description List of available models */
1901
+ models?: string[];
1902
+ /** @description Optional prefix for model namespacing */
1903
+ prefix?: string | null;
1904
+ /** @description Whether to forward all requests with this prefix */
1905
+ forward_all_with_prefix?: boolean;
1906
+ };
1907
+ LlmLibertyAuthSpec: {
1908
+ in: string;
1909
+ key: string;
1910
+ scheme: string;
1911
+ };
1912
+ /** @description The JSON blob emitted by `npx @bodhiapp/llm-liberty@latest login`.
1913
+ *
1914
+ * Version field allows BodhiApp to detect breaking changes in the envelope
1915
+ * schema (major-version bump = breaking). Currently only `"1.0.0"` is accepted. */
1916
+ LlmLibertyEnvelope: {
1917
+ /** @description Envelope schema version — must be "1.0.0". */
1918
+ version: string;
1919
+ /** @description Provider identifier, e.g. "anthropic" or "openai-codex". */
1920
+ provider: string;
1921
+ access_token: string;
1922
+ refresh_token: string;
1923
+ /**
1924
+ * Format: int64
1925
+ * @description Unix epoch seconds when the access token expires.
1926
+ */
1927
+ expires_at: number;
1928
+ auth: components["schemas"]["LlmLibertyAuthSpec"];
1929
+ oauth: components["schemas"]["LlmLibertyOauthEndpoints"];
1930
+ api: components["schemas"]["LlmLibertyApiEndpoints"];
1931
+ headers?: unknown;
1932
+ body?: unknown;
1933
+ extra?: unknown;
1934
+ };
1935
+ /** @description Tagged envelope update action — either keep the existing credentials or replace them. */
1936
+ LlmLibertyEnvelopeUpdate: {
1937
+ /** @enum {string} */
1938
+ action: "keep";
1939
+ } | {
1940
+ /** @description Replace with a new envelope (atomic re-paste). */
1941
+ value: components["schemas"]["LlmLibertyEnvelope"];
1942
+ /** @enum {string} */
1943
+ action: "set";
1944
+ };
1945
+ /** @description Inner request for `api_format == "llm_liberty_oauth"`. Either `id` (use stored creds)
1946
+ * or `envelope` (use the provided envelope directly) must be set, never both. */
1947
+ LlmLibertyFetchModelsRequest: {
1948
+ /** @description Edit mode: alias id whose stored credentials should be used. */
1949
+ id?: string | null;
1950
+ envelope?: null | components["schemas"]["LlmLibertyEnvelope"];
1951
+ };
1952
+ LlmLibertyOauthEndpoints: {
1953
+ authorize_url: string;
1954
+ token_url: string;
1955
+ revoke_url?: string | null;
1956
+ client_id: string;
1957
+ client_secret?: string | null;
1958
+ };
1959
+ /** @description Non-secret summary of stored LLM Liberty OAuth credentials for API responses. */
1960
+ LlmLibertySummary: {
1961
+ provider: string;
1962
+ envelope_version: string;
1963
+ /**
1964
+ * Format: int64
1965
+ * @description Unix epoch seconds — when the stored access token expires.
1966
+ */
1967
+ expires_at: number;
1968
+ has_refresh_token: boolean;
1969
+ };
1970
+ /** @description Inner request for `api_format == "llm_liberty_oauth"`. Either `id` (use stored creds)
1971
+ * or `envelope` (use the provided envelope directly) must be set, never both. */
1972
+ LlmLibertyTestPromptRequest: {
1973
+ /** @description Edit mode: alias id whose stored credentials should be used. */
1974
+ id?: string | null;
1975
+ envelope?: null | components["schemas"]["LlmLibertyEnvelope"];
1976
+ /** @description Model to use for testing */
1977
+ model: string;
1978
+ /** @description Test prompt (max 30 characters for cost control) */
1979
+ prompt: string;
1980
+ };
1835
1981
  /** @description Local model file response */
1836
1982
  LocalModelResponse: {
1837
1983
  repo: string;
@@ -2412,8 +2558,9 @@ export interface components {
2412
2558
  type: "api_key";
2413
2559
  };
2414
2560
  /**
2415
- * @description Request to test API connectivity with a prompt
2561
+ * @description Request to test API connectivity with a prompt. Discriminated on `api_format`.
2416
2562
  * @example {
2563
+ * "api_format": "openai",
2417
2564
  * "base_url": "https://api.openai.com/v1",
2418
2565
  * "creds": {
2419
2566
  * "type": "api_key",
@@ -2423,22 +2570,25 @@ export interface components {
2423
2570
  * "prompt": "Hello, how are you?"
2424
2571
  * }
2425
2572
  */
2426
- TestPromptRequest: {
2427
- /** @description Credentials to use for testing */
2428
- creds?: components["schemas"]["TestCreds"];
2429
- /** @description API base URL */
2430
- base_url: string;
2431
- /** @description Model to use for testing */
2432
- model: string;
2433
- /** @description Test prompt (max 30 characters for cost control) */
2434
- prompt: string;
2435
- /** @description API format to use for the test request (defaults to OpenAI Chat Completions) */
2436
- api_format?: components["schemas"]["ApiFormat"];
2437
- /** @description Optional extra HTTP headers. `Authorization` / `x-api-key` are forbidden. */
2438
- extra_headers?: unknown;
2439
- /** @description Optional extra fields to merge into the request body */
2440
- extra_body?: unknown;
2441
- };
2573
+ TestPromptRequest: (components["schemas"]["DefaultTestPromptRequest"] & {
2574
+ /** @enum {string} */
2575
+ api_format: "openai";
2576
+ }) | (components["schemas"]["DefaultTestPromptRequest"] & {
2577
+ /** @enum {string} */
2578
+ api_format: "openai_responses";
2579
+ }) | (components["schemas"]["DefaultTestPromptRequest"] & {
2580
+ /** @enum {string} */
2581
+ api_format: "anthropic";
2582
+ }) | (components["schemas"]["DefaultTestPromptRequest"] & {
2583
+ /** @enum {string} */
2584
+ api_format: "anthropic_oauth";
2585
+ }) | (components["schemas"]["DefaultTestPromptRequest"] & {
2586
+ /** @enum {string} */
2587
+ api_format: "gemini";
2588
+ }) | (components["schemas"]["LlmLibertyTestPromptRequest"] & {
2589
+ /** @enum {string} */
2590
+ api_format: "llm_liberty_oauth";
2591
+ });
2442
2592
  /**
2443
2593
  * @description Response from testing API connectivity
2444
2594
  * @example {
@@ -5706,6 +5856,7 @@ export interface operations {
5706
5856
  * "openai_responses",
5707
5857
  * "anthropic",
5708
5858
  * "anthropic_oauth",
5859
+ * "llm_liberty_oauth",
5709
5860
  * "gemini"
5710
5861
  * ]
5711
5862
  * } */