@simo-online/sdk 3.0.0
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.
- package/README.md +143 -0
- package/dist/client.d.ts +120 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +333 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +168 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# @simo-online/sdk — SIMOSphere AI TypeScript SDK
|
|
2
|
+
|
|
3
|
+
Official TypeScript / JavaScript client for the [SIMOSphere AI gateway](https://api.simosphereai.com).
|
|
4
|
+
|
|
5
|
+
- OpenAI-compatible `chat.completions` (sync + streaming)
|
|
6
|
+
- Tenant admin: API keys, usage, credits, files
|
|
7
|
+
- Zero runtime dependencies — uses native `fetch` (Node 18.17+ / modern browsers)
|
|
8
|
+
- Typed end-to-end against the published OpenAPI 3.1 spec
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @simo-online/sdk
|
|
14
|
+
# or
|
|
15
|
+
pnpm add @simo-online/sdk
|
|
16
|
+
# or
|
|
17
|
+
yarn add @simo-online/sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { SimoClient } from '@simo-online/sdk';
|
|
24
|
+
|
|
25
|
+
const simo = new SimoClient({ apiKey: process.env.SIMO_API_KEY! });
|
|
26
|
+
|
|
27
|
+
// 1. Chat completion (OpenAI-compatible)
|
|
28
|
+
const chat = await simo.chat.completions.create({
|
|
29
|
+
model: 'apertus-8b-eu',
|
|
30
|
+
messages: [
|
|
31
|
+
{ role: 'system', content: 'Du bist ein hilfreicher Assistent.' },
|
|
32
|
+
{ role: 'user', content: 'Was ist Datensouveraenitaet?' },
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
console.log(chat.choices[0].message.content);
|
|
36
|
+
|
|
37
|
+
// 2. Streaming
|
|
38
|
+
for await (const chunk of simo.chat.completions.createStream({
|
|
39
|
+
model: 'apertus-8b-eu',
|
|
40
|
+
messages: [{ role: 'user', content: 'Schreibe ein Haiku ueber Souveraenitaet.' }],
|
|
41
|
+
})) {
|
|
42
|
+
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 3. List models
|
|
46
|
+
const models = await simo.models.list();
|
|
47
|
+
console.log(models.data.map((m) => m.id));
|
|
48
|
+
|
|
49
|
+
// 4. Manage API keys
|
|
50
|
+
const key = await simo.keys.create({ name: 'ci-pipeline', scopes: ['chat:write'] });
|
|
51
|
+
console.log('New key (shown once):', key.token);
|
|
52
|
+
|
|
53
|
+
// 5. Check credit balance
|
|
54
|
+
const credit = await simo.credits.balance();
|
|
55
|
+
console.log(`Balance: ${credit.balance_eur} EUR`);
|
|
56
|
+
|
|
57
|
+
// 6. Usage summary
|
|
58
|
+
const usage = await simo.usage.summary({ from: '2026-05-01', to: '2026-05-31' });
|
|
59
|
+
console.log(`${usage.total_requests} requests · ${usage.total_input_tokens + usage.total_output_tokens} tokens`);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
| Option | Default | Notes |
|
|
65
|
+
| ---------------- | ------------------------------------ | ---------------------------------------------- |
|
|
66
|
+
| `apiKey` | (required) | Issued via dashboard or `simo keys create` |
|
|
67
|
+
| `baseUrl` | `https://api.simosphereai.com` | Use `sandbox.api.simosphereai.com` for testing |
|
|
68
|
+
| `timeoutMs` | `60000` | Per-request timeout |
|
|
69
|
+
| `fetch` | `globalThis.fetch` | Pass `undici` or `node-fetch` if needed |
|
|
70
|
+
| `defaultHeaders` | `{}` | Merged into every request |
|
|
71
|
+
|
|
72
|
+
## Error handling
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { SimoClient, SimoApiError } from '@simo-online/sdk';
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
await simo.chat.completions.create({ model: 'x', messages: [] });
|
|
79
|
+
} catch (err) {
|
|
80
|
+
if (err instanceof SimoApiError) {
|
|
81
|
+
console.error(err.status, err.body?.error?.type, err.body?.error?.message);
|
|
82
|
+
console.error('Request ID for support:', err.requestId);
|
|
83
|
+
} else {
|
|
84
|
+
throw err;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Idempotency
|
|
90
|
+
|
|
91
|
+
Pass `idempotencyKey` on any mutating call to dedupe retries server-side:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
await simo.keys.create(
|
|
95
|
+
{ name: 'webhook-2026-05-25' },
|
|
96
|
+
{ idempotencyKey: 'create-webhook-key-once' },
|
|
97
|
+
);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Cancellation
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
const controller = new AbortController();
|
|
104
|
+
setTimeout(() => controller.abort(), 5000);
|
|
105
|
+
|
|
106
|
+
await simo.chat.completions.create(
|
|
107
|
+
{ model: 'apertus-8b-eu', messages: [{ role: 'user', content: '...' }] },
|
|
108
|
+
{ signal: controller.signal },
|
|
109
|
+
);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## OpenAI SDK migration
|
|
113
|
+
|
|
114
|
+
```diff
|
|
115
|
+
- import OpenAI from 'openai';
|
|
116
|
+
- const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
|
|
117
|
+
+ import { SimoClient } from '@simo-online/sdk';
|
|
118
|
+
+ const client = new SimoClient({ apiKey: process.env.SIMO_API_KEY });
|
|
119
|
+
|
|
120
|
+
const chat = await client.chat.completions.create({
|
|
121
|
+
- model: 'gpt-4o-mini',
|
|
122
|
+
+ model: 'apertus-8b-eu',
|
|
123
|
+
messages: [{ role: 'user', content: 'Hello' }],
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Versioning & stability
|
|
128
|
+
|
|
129
|
+
- Follows [Semantic Versioning](https://semver.org/).
|
|
130
|
+
- Tracks the gateway's published `2026-05-18` API contract; method names mirror the OpenAI SDK so familiar code ports cleanly.
|
|
131
|
+
- `SIMOSphere` (capital) is a back-compat alias for the 0.0.x preview SDK and will be removed in 0.3.0.
|
|
132
|
+
|
|
133
|
+
## Links
|
|
134
|
+
|
|
135
|
+
- Gateway docs: <https://onboarding.simosphereai.com/llms-full.txt>
|
|
136
|
+
- OpenAPI spec: <https://api.simosphereai.com/openapi.json>
|
|
137
|
+
- Issue tracker: <https://github.com/SIMOSphereOS/simosphere-ai-api-platform/issues>
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Business Source License 1.1 — see `LICENSE`.
|
|
142
|
+
|
|
143
|
+
Engineered at SIMO GmbH · Aschaffenburg, Germany.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { ApiErrorBody, ApiKey, ChatCompletion, ChatCompletionChunk, ChatCompletionRequest, CreateApiKeyRequest, CreditBalance, ModelList, RequestOptions, UploadedFile, UsageSummary } from './types.js';
|
|
2
|
+
export interface SimoClientOptions {
|
|
3
|
+
/** Tenant API key issued via the dashboard or `simo keys create`. Required. */
|
|
4
|
+
apiKey: string;
|
|
5
|
+
/** Override the gateway base URL. Defaults to https://api.simosphereai.com. */
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
/** Default request timeout in milliseconds. Defaults to 60_000. */
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
/** Custom fetch implementation (mainly for testing). */
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
/** Additional headers attached to every request. */
|
|
12
|
+
defaultHeaders?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thrown for any non-2xx response. Carries the parsed OpenAI-style
|
|
16
|
+
* error envelope when the server returned one.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SimoApiError extends Error {
|
|
19
|
+
readonly status: number;
|
|
20
|
+
readonly body: ApiErrorBody | null;
|
|
21
|
+
readonly requestId: string | null;
|
|
22
|
+
constructor(message: string, status: number, body: ApiErrorBody | null, requestId: string | null);
|
|
23
|
+
}
|
|
24
|
+
export declare class SimoClient {
|
|
25
|
+
readonly apiKey: string;
|
|
26
|
+
readonly baseUrl: string;
|
|
27
|
+
readonly timeoutMs: number;
|
|
28
|
+
private readonly fetchImpl;
|
|
29
|
+
private readonly defaultHeaders;
|
|
30
|
+
readonly chat: ChatNamespace;
|
|
31
|
+
readonly models: ModelsNamespace;
|
|
32
|
+
readonly files: FilesNamespace;
|
|
33
|
+
readonly keys: KeysNamespace;
|
|
34
|
+
readonly credits: CreditsNamespace;
|
|
35
|
+
readonly usage: UsageNamespace;
|
|
36
|
+
constructor(opts: SimoClientOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Low-level HTTP transport. All namespaces go through here so auth,
|
|
39
|
+
* error parsing, and timeout handling stay in one place.
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
request<T>(method: 'GET' | 'POST' | 'PATCH' | 'DELETE', path: string, init?: {
|
|
44
|
+
body?: unknown;
|
|
45
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
46
|
+
options?: RequestOptions;
|
|
47
|
+
contentType?: string;
|
|
48
|
+
raw?: boolean;
|
|
49
|
+
}): Promise<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Server-Sent-Events streaming transport for `stream: true` chat
|
|
52
|
+
* completions. Yields parsed chunks until the gateway sends
|
|
53
|
+
* `data: [DONE]`.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
stream<T>(path: string, body: unknown, options?: RequestOptions): AsyncGenerator<T>;
|
|
58
|
+
}
|
|
59
|
+
declare class ChatNamespace {
|
|
60
|
+
readonly completions: ChatCompletionsNamespace;
|
|
61
|
+
constructor(client: SimoClient);
|
|
62
|
+
}
|
|
63
|
+
declare class ChatCompletionsNamespace {
|
|
64
|
+
private readonly client;
|
|
65
|
+
constructor(client: SimoClient);
|
|
66
|
+
/**
|
|
67
|
+
* Create a chat completion. When `stream: true`, use `createStream()`
|
|
68
|
+
* instead — this overload throws to keep the typed return safe.
|
|
69
|
+
*/
|
|
70
|
+
create(body: ChatCompletionRequest & {
|
|
71
|
+
stream?: false;
|
|
72
|
+
}, options?: RequestOptions): Promise<ChatCompletion>;
|
|
73
|
+
/** Streaming variant — returns an async iterator of SSE chunks. */
|
|
74
|
+
createStream(body: ChatCompletionRequest, options?: RequestOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
75
|
+
}
|
|
76
|
+
declare class ModelsNamespace {
|
|
77
|
+
private readonly client;
|
|
78
|
+
constructor(client: SimoClient);
|
|
79
|
+
list(options?: RequestOptions): Promise<ModelList>;
|
|
80
|
+
retrieve(id: string, options?: RequestOptions): Promise<ModelList['data'][number]>;
|
|
81
|
+
}
|
|
82
|
+
declare class FilesNamespace {
|
|
83
|
+
private readonly client;
|
|
84
|
+
constructor(client: SimoClient);
|
|
85
|
+
/**
|
|
86
|
+
* Upload a file. Accepts a Web `File`, a `Blob` + filename, or a
|
|
87
|
+
* Node `Buffer` / `Uint8Array` + filename.
|
|
88
|
+
*/
|
|
89
|
+
upload(file: Blob | {
|
|
90
|
+
data: Uint8Array;
|
|
91
|
+
filename: string;
|
|
92
|
+
contentType?: string;
|
|
93
|
+
}, purpose?: UploadedFile['purpose'], options?: RequestOptions): Promise<UploadedFile>;
|
|
94
|
+
get(id: string, options?: RequestOptions): Promise<UploadedFile>;
|
|
95
|
+
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
declare class KeysNamespace {
|
|
98
|
+
private readonly client;
|
|
99
|
+
constructor(client: SimoClient);
|
|
100
|
+
list(options?: RequestOptions): Promise<{
|
|
101
|
+
data: ApiKey[];
|
|
102
|
+
}>;
|
|
103
|
+
create(body: CreateApiKeyRequest, options?: RequestOptions): Promise<ApiKey>;
|
|
104
|
+
revoke(id: string, options?: RequestOptions): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
declare class CreditsNamespace {
|
|
107
|
+
private readonly client;
|
|
108
|
+
constructor(client: SimoClient);
|
|
109
|
+
balance(options?: RequestOptions): Promise<CreditBalance>;
|
|
110
|
+
}
|
|
111
|
+
declare class UsageNamespace {
|
|
112
|
+
private readonly client;
|
|
113
|
+
constructor(client: SimoClient);
|
|
114
|
+
summary(range?: {
|
|
115
|
+
from?: string;
|
|
116
|
+
to?: string;
|
|
117
|
+
}, options?: RequestOptions): Promise<UsageSummary>;
|
|
118
|
+
}
|
|
119
|
+
export {};
|
|
120
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;;GAGG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|
+
//
|
|
6
|
+
// Design rules:
|
|
7
|
+
// 1. Single transport (`request<T>`) handles auth, headers, timeouts,
|
|
8
|
+
// idempotency keys, and structured error parsing. All resource
|
|
9
|
+
// namespaces (chat, models, files, keys, credits, usage) delegate
|
|
10
|
+
// to it so behaviour stays uniform.
|
|
11
|
+
// 2. Public namespaces follow the OpenAI SDK shape where possible
|
|
12
|
+
// (`client.chat.completions.create(...)`, `client.models.list()`)
|
|
13
|
+
// so existing OpenAI-SDK code ports with a one-line swap.
|
|
14
|
+
// 3. No external runtime deps. `fetch` is native on Node 18.17+ and
|
|
15
|
+
// every modern browser; we only assume the standard `Request`,
|
|
16
|
+
// `Response`, `AbortController`, `TextDecoder` surface.
|
|
17
|
+
const DEFAULT_BASE_URL = 'https://api.simosphereai.com';
|
|
18
|
+
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
19
|
+
const SDK_USER_AGENT = 'simo-online-sdk-js/0.1.0';
|
|
20
|
+
/**
|
|
21
|
+
* Thrown for any non-2xx response. Carries the parsed OpenAI-style
|
|
22
|
+
* error envelope when the server returned one.
|
|
23
|
+
*/
|
|
24
|
+
export class SimoApiError extends Error {
|
|
25
|
+
status;
|
|
26
|
+
body;
|
|
27
|
+
requestId;
|
|
28
|
+
constructor(message, status, body, requestId) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = 'SimoApiError';
|
|
31
|
+
this.status = status;
|
|
32
|
+
this.body = body;
|
|
33
|
+
this.requestId = requestId;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class SimoClient {
|
|
37
|
+
apiKey;
|
|
38
|
+
baseUrl;
|
|
39
|
+
timeoutMs;
|
|
40
|
+
fetchImpl;
|
|
41
|
+
defaultHeaders;
|
|
42
|
+
chat;
|
|
43
|
+
models;
|
|
44
|
+
files;
|
|
45
|
+
keys;
|
|
46
|
+
credits;
|
|
47
|
+
usage;
|
|
48
|
+
constructor(opts) {
|
|
49
|
+
if (!opts.apiKey || typeof opts.apiKey !== 'string') {
|
|
50
|
+
throw new TypeError('SimoClient: `apiKey` is required (got: ' + typeof opts.apiKey + ')');
|
|
51
|
+
}
|
|
52
|
+
this.apiKey = opts.apiKey;
|
|
53
|
+
this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
54
|
+
this.timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
55
|
+
this.fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
56
|
+
this.defaultHeaders = opts.defaultHeaders ?? {};
|
|
57
|
+
if (typeof this.fetchImpl !== 'function') {
|
|
58
|
+
throw new TypeError('SimoClient: global `fetch` is not available. Use Node 18.17+ or pass `fetch` explicitly.');
|
|
59
|
+
}
|
|
60
|
+
this.chat = new ChatNamespace(this);
|
|
61
|
+
this.models = new ModelsNamespace(this);
|
|
62
|
+
this.files = new FilesNamespace(this);
|
|
63
|
+
this.keys = new KeysNamespace(this);
|
|
64
|
+
this.credits = new CreditsNamespace(this);
|
|
65
|
+
this.usage = new UsageNamespace(this);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Low-level HTTP transport. All namespaces go through here so auth,
|
|
69
|
+
* error parsing, and timeout handling stay in one place.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
async request(method, path, init = {}) {
|
|
74
|
+
const url = new URL(path.startsWith('/') ? path : `/${path}`, this.baseUrl + '/');
|
|
75
|
+
if (init.query) {
|
|
76
|
+
for (const [k, v] of Object.entries(init.query)) {
|
|
77
|
+
if (v === undefined)
|
|
78
|
+
continue;
|
|
79
|
+
url.searchParams.set(k, String(v));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const headers = {
|
|
83
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
84
|
+
'X-API-Key': this.apiKey,
|
|
85
|
+
Accept: 'application/json',
|
|
86
|
+
'User-Agent': SDK_USER_AGENT,
|
|
87
|
+
...this.defaultHeaders,
|
|
88
|
+
...(init.options?.headers ?? {}),
|
|
89
|
+
};
|
|
90
|
+
if (init.body !== undefined && !init.raw) {
|
|
91
|
+
headers['Content-Type'] = init.contentType ?? 'application/json';
|
|
92
|
+
}
|
|
93
|
+
if (init.options?.idempotencyKey) {
|
|
94
|
+
headers['Idempotency-Key'] = init.options.idempotencyKey;
|
|
95
|
+
}
|
|
96
|
+
const controller = new AbortController();
|
|
97
|
+
const timeout = setTimeout(() => controller.abort(), init.options?.timeoutMs ?? this.timeoutMs);
|
|
98
|
+
if (init.options?.signal) {
|
|
99
|
+
init.options.signal.addEventListener('abort', () => controller.abort(), { once: true });
|
|
100
|
+
}
|
|
101
|
+
let res;
|
|
102
|
+
try {
|
|
103
|
+
res = await this.fetchImpl(url.toString(), {
|
|
104
|
+
method,
|
|
105
|
+
headers,
|
|
106
|
+
body: init.body === undefined
|
|
107
|
+
? undefined
|
|
108
|
+
: init.raw
|
|
109
|
+
? init.body
|
|
110
|
+
: JSON.stringify(init.body),
|
|
111
|
+
signal: controller.signal,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
clearTimeout(timeout);
|
|
116
|
+
}
|
|
117
|
+
const requestId = res.headers.get('x-request-id') ?? res.headers.get('x-correlation-id');
|
|
118
|
+
if (!res.ok) {
|
|
119
|
+
let body = null;
|
|
120
|
+
try {
|
|
121
|
+
body = (await res.json());
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
body = null;
|
|
125
|
+
}
|
|
126
|
+
throw new SimoApiError(body?.error?.message ?? `Request failed (${res.status} ${res.statusText})`, res.status, body, requestId);
|
|
127
|
+
}
|
|
128
|
+
// 204 No Content
|
|
129
|
+
if (res.status === 204)
|
|
130
|
+
return undefined;
|
|
131
|
+
const contentType = res.headers.get('content-type') ?? '';
|
|
132
|
+
if (contentType.includes('application/json') || contentType.includes('+json')) {
|
|
133
|
+
return (await res.json());
|
|
134
|
+
}
|
|
135
|
+
return (await res.text());
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Server-Sent-Events streaming transport for `stream: true` chat
|
|
139
|
+
* completions. Yields parsed chunks until the gateway sends
|
|
140
|
+
* `data: [DONE]`.
|
|
141
|
+
*
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
async *stream(path, body, options) {
|
|
145
|
+
const url = new URL(path.startsWith('/') ? path : `/${path}`, this.baseUrl + '/');
|
|
146
|
+
const controller = new AbortController();
|
|
147
|
+
const timeout = setTimeout(() => controller.abort(), options?.timeoutMs ?? this.timeoutMs);
|
|
148
|
+
if (options?.signal) {
|
|
149
|
+
options.signal.addEventListener('abort', () => controller.abort(), { once: true });
|
|
150
|
+
}
|
|
151
|
+
let res;
|
|
152
|
+
try {
|
|
153
|
+
res = await this.fetchImpl(url.toString(), {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: {
|
|
156
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
157
|
+
'X-API-Key': this.apiKey,
|
|
158
|
+
'Content-Type': 'application/json',
|
|
159
|
+
Accept: 'text/event-stream',
|
|
160
|
+
'User-Agent': SDK_USER_AGENT,
|
|
161
|
+
...this.defaultHeaders,
|
|
162
|
+
...(options?.headers ?? {}),
|
|
163
|
+
},
|
|
164
|
+
body: JSON.stringify(body),
|
|
165
|
+
signal: controller.signal,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
clearTimeout(timeout);
|
|
170
|
+
throw err;
|
|
171
|
+
}
|
|
172
|
+
if (!res.ok || !res.body) {
|
|
173
|
+
clearTimeout(timeout);
|
|
174
|
+
const parsed = await res.json().catch(() => null);
|
|
175
|
+
throw new SimoApiError(parsed?.error?.message ?? `Stream failed (${res.status})`, res.status, parsed, res.headers.get('x-request-id'));
|
|
176
|
+
}
|
|
177
|
+
const reader = res.body.getReader();
|
|
178
|
+
const decoder = new TextDecoder();
|
|
179
|
+
let buf = '';
|
|
180
|
+
try {
|
|
181
|
+
while (true) {
|
|
182
|
+
const { done, value } = await reader.read();
|
|
183
|
+
if (done)
|
|
184
|
+
break;
|
|
185
|
+
buf += decoder.decode(value, { stream: true });
|
|
186
|
+
const events = buf.split('\n\n');
|
|
187
|
+
buf = events.pop() ?? '';
|
|
188
|
+
for (const evt of events) {
|
|
189
|
+
for (const line of evt.split('\n')) {
|
|
190
|
+
if (!line.startsWith('data:'))
|
|
191
|
+
continue;
|
|
192
|
+
const payload = line.slice(5).trim();
|
|
193
|
+
if (payload === '[DONE]')
|
|
194
|
+
return;
|
|
195
|
+
if (!payload)
|
|
196
|
+
continue;
|
|
197
|
+
try {
|
|
198
|
+
yield JSON.parse(payload);
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Skip malformed chunk — gateway never emits these but
|
|
202
|
+
// proxies (Cloudflare) occasionally inject keep-alives.
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
clearTimeout(timeout);
|
|
210
|
+
try {
|
|
211
|
+
reader.releaseLock();
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
/* already released */
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// ─── Namespaces ─────────────────────────────────────────────────────
|
|
220
|
+
class ChatNamespace {
|
|
221
|
+
completions;
|
|
222
|
+
constructor(client) {
|
|
223
|
+
this.completions = new ChatCompletionsNamespace(client);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
class ChatCompletionsNamespace {
|
|
227
|
+
client;
|
|
228
|
+
constructor(client) {
|
|
229
|
+
this.client = client;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create a chat completion. When `stream: true`, use `createStream()`
|
|
233
|
+
* instead — this overload throws to keep the typed return safe.
|
|
234
|
+
*/
|
|
235
|
+
async create(body, options) {
|
|
236
|
+
if (body.stream) {
|
|
237
|
+
throw new TypeError('SimoClient.chat.completions.create: pass `stream: true` to createStream() instead.');
|
|
238
|
+
}
|
|
239
|
+
return this.client.request('POST', '/v1/chat/completions', {
|
|
240
|
+
body: { ...body, stream: false },
|
|
241
|
+
options,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/** Streaming variant — returns an async iterator of SSE chunks. */
|
|
245
|
+
createStream(body, options) {
|
|
246
|
+
return this.client.stream('/v1/chat/completions', { ...body, stream: true }, options);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
class ModelsNamespace {
|
|
250
|
+
client;
|
|
251
|
+
constructor(client) {
|
|
252
|
+
this.client = client;
|
|
253
|
+
}
|
|
254
|
+
async list(options) {
|
|
255
|
+
return this.client.request('GET', '/v1/models', { options });
|
|
256
|
+
}
|
|
257
|
+
async retrieve(id, options) {
|
|
258
|
+
return this.client.request('GET', `/v1/models/${encodeURIComponent(id)}`, { options });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
class FilesNamespace {
|
|
262
|
+
client;
|
|
263
|
+
constructor(client) {
|
|
264
|
+
this.client = client;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Upload a file. Accepts a Web `File`, a `Blob` + filename, or a
|
|
268
|
+
* Node `Buffer` / `Uint8Array` + filename.
|
|
269
|
+
*/
|
|
270
|
+
async upload(file, purpose = 'user_data', options) {
|
|
271
|
+
const form = new FormData();
|
|
272
|
+
if (file instanceof Blob) {
|
|
273
|
+
form.append('file', file, file.name ?? 'upload.bin');
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
const blob = new Blob([file.data], {
|
|
277
|
+
type: file.contentType ?? 'application/octet-stream',
|
|
278
|
+
});
|
|
279
|
+
form.append('file', blob, file.filename);
|
|
280
|
+
}
|
|
281
|
+
form.append('purpose', purpose);
|
|
282
|
+
return this.client.request('POST', '/v1/files', {
|
|
283
|
+
body: form,
|
|
284
|
+
raw: true,
|
|
285
|
+
options,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
async get(id, options) {
|
|
289
|
+
return this.client.request('GET', `/v1/files/${encodeURIComponent(id)}`, {
|
|
290
|
+
options,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
async delete(id, options) {
|
|
294
|
+
await this.client.request('DELETE', `/v1/files/${encodeURIComponent(id)}`, { options });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
class KeysNamespace {
|
|
298
|
+
client;
|
|
299
|
+
constructor(client) {
|
|
300
|
+
this.client = client;
|
|
301
|
+
}
|
|
302
|
+
async list(options) {
|
|
303
|
+
return this.client.request('GET', '/admin/keys', { options });
|
|
304
|
+
}
|
|
305
|
+
async create(body, options) {
|
|
306
|
+
return this.client.request('POST', '/admin/keys', { body, options });
|
|
307
|
+
}
|
|
308
|
+
async revoke(id, options) {
|
|
309
|
+
await this.client.request('DELETE', `/admin/keys/${encodeURIComponent(id)}`, { options });
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
class CreditsNamespace {
|
|
313
|
+
client;
|
|
314
|
+
constructor(client) {
|
|
315
|
+
this.client = client;
|
|
316
|
+
}
|
|
317
|
+
async balance(options) {
|
|
318
|
+
return this.client.request('GET', '/admin/billing/status', { options });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
class UsageNamespace {
|
|
322
|
+
client;
|
|
323
|
+
constructor(client) {
|
|
324
|
+
this.client = client;
|
|
325
|
+
}
|
|
326
|
+
async summary(range, options) {
|
|
327
|
+
return this.client.request('GET', '/admin/usage', {
|
|
328
|
+
query: range,
|
|
329
|
+
options,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,gBAAg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,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO,QAAQ,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AAED,MAAM,gBAAgB;IACS;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,OAAO,CAAC,OAAwB;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAgB,KAAK,EAAE,uBAAuB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AAED,MAAM,cAAc;IACW;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,OAAO,CACX,KAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAe,KAAK,EAAE,cAAc,EAAE;YAC9D,KAAK,EAAE,KAAK;YACZ,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { SimoClient, SimoApiError } from './client.js';
|
|
2
|
+
export type { SimoClientOptions } from './client.js';
|
|
3
|
+
export type { ApiErrorBody, ApiKey, ChatCompletion, ChatCompletionChoice, ChatCompletionChunk, ChatCompletionChunkChoice, ChatCompletionRequest, ChatCompletionUsage, ChatMessage, CreateApiKeyRequest, CreditBalance, ModelInfo, ModelList, RequestOptions, UploadedFile, UsageSummary, } from './types.js';
|
|
4
|
+
import { SimoClient, type SimoClientOptions } from './client.js';
|
|
5
|
+
import type { ChatCompletion, ChatCompletionChunk, ChatCompletionRequest, ChatMessage, ModelInfo } from './types.js';
|
|
6
|
+
/** @deprecated Use {@link SimoClient} directly. */
|
|
7
|
+
export declare class SIMOSphere {
|
|
8
|
+
private readonly client;
|
|
9
|
+
constructor(opts: SimoClientOptions);
|
|
10
|
+
chat(opts: {
|
|
11
|
+
model?: string;
|
|
12
|
+
messages: ChatMessage[];
|
|
13
|
+
max_tokens?: number;
|
|
14
|
+
temperature?: number;
|
|
15
|
+
tools?: ChatCompletionRequest['tools'];
|
|
16
|
+
}): Promise<ChatCompletion>;
|
|
17
|
+
stream(opts: {
|
|
18
|
+
model?: string;
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
max_tokens?: number;
|
|
21
|
+
temperature?: number;
|
|
22
|
+
}): AsyncGenerator<ChatCompletionChunk>;
|
|
23
|
+
ask(question: string, model?: string): Promise<string>;
|
|
24
|
+
models(): Promise<ModelInfo[]>;
|
|
25
|
+
}
|
|
26
|
+
export default SimoClient;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,YAAY,EACV,YAAY,EACZ,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAErH,mDAAmD;AACnD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;gBAExB,IAAI,EAAE,iBAAiB;IAI7B,IAAI,CAAC,IAAI,EAAE;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,WAAW,EAAE,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;KACxC,GAAG,OAAO,CAAC,cAAc,CAAC;IAUpB,MAAM,CAAC,IAAI,EAAE;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,WAAW,EAAE,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,cAAc,CAAC,mBAAmB,CAAC;IASjC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQtD,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;CAIrC;AAED,eAAe,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// Copyright (c) 2026 SIMO GmbH, Aschaffenburg, Germany.
|
|
3
|
+
//
|
|
4
|
+
// Public entry point for @simo-online/sdk.
|
|
5
|
+
//
|
|
6
|
+
// The canonical client is `SimoClient`. `SIMOSphere` is exported as a
|
|
7
|
+
// deprecation alias for the 0.0.x preview SDK that lived in this
|
|
8
|
+
// folder before the rename; new code should import `SimoClient`.
|
|
9
|
+
export { SimoClient, SimoApiError } from './client.js';
|
|
10
|
+
// ─── Back-compat alias ──────────────────────────────────────────────
|
|
11
|
+
//
|
|
12
|
+
// Old 0.0.x preview SDK exposed a `SIMOSphere` class with `chat()`,
|
|
13
|
+
// `stream()`, `ask()`, `models()`. The new shape is `SimoClient` with
|
|
14
|
+
// namespaces (`client.chat.completions.create(...)`,
|
|
15
|
+
// `client.models.list()`). The thin wrapper below keeps the old
|
|
16
|
+
// surface so a single-line import swap (`@simo/ai` → `@simo-online/sdk`)
|
|
17
|
+
// does not break callers. Remove in v0.3.0.
|
|
18
|
+
import { SimoClient } from './client.js';
|
|
19
|
+
/** @deprecated Use {@link SimoClient} directly. */
|
|
20
|
+
export class SIMOSphere {
|
|
21
|
+
client;
|
|
22
|
+
constructor(opts) {
|
|
23
|
+
this.client = new SimoClient(opts);
|
|
24
|
+
}
|
|
25
|
+
async chat(opts) {
|
|
26
|
+
return this.client.chat.completions.create({
|
|
27
|
+
model: opts.model ?? 'qwen/qwen3-8b',
|
|
28
|
+
messages: opts.messages,
|
|
29
|
+
max_tokens: opts.max_tokens,
|
|
30
|
+
temperature: opts.temperature,
|
|
31
|
+
tools: opts.tools,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async *stream(opts) {
|
|
35
|
+
yield* this.client.chat.completions.createStream({
|
|
36
|
+
model: opts.model ?? 'qwen/qwen3-8b',
|
|
37
|
+
messages: opts.messages,
|
|
38
|
+
max_tokens: opts.max_tokens,
|
|
39
|
+
temperature: opts.temperature,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async ask(question, model) {
|
|
43
|
+
const result = await this.chat({
|
|
44
|
+
model,
|
|
45
|
+
messages: [{ role: 'user', content: question }],
|
|
46
|
+
});
|
|
47
|
+
return result.choices[0]?.message?.content ?? '';
|
|
48
|
+
}
|
|
49
|
+
async models() {
|
|
50
|
+
const list = await this.client.models.list();
|
|
51
|
+
return list.data;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export default SimoClient;
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,2CAA2C;AAC3C,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,iEAAiE;AAEjE,OAAO,EAAE,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H,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAED,eAAe,UAAU,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export interface ApiErrorBody {
|
|
2
|
+
error: {
|
|
3
|
+
message: string;
|
|
4
|
+
type: 'auth_error' | 'rate_limit' | 'validation_error' | 'invalid_request_error' | 'not_found' | 'idempotency_conflict' | 'byok_provider_missing' | 'request_error' | 'server_error';
|
|
5
|
+
code?: string;
|
|
6
|
+
param?: string | null;
|
|
7
|
+
retry_after?: number | null;
|
|
8
|
+
details?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ChatMessage {
|
|
12
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
13
|
+
content: string | null;
|
|
14
|
+
name?: string;
|
|
15
|
+
tool_call_id?: string;
|
|
16
|
+
tool_calls?: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
type: 'function';
|
|
19
|
+
function: {
|
|
20
|
+
name: string;
|
|
21
|
+
arguments: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface ChatCompletionRequest {
|
|
26
|
+
model: string;
|
|
27
|
+
messages: ChatMessage[];
|
|
28
|
+
temperature?: number;
|
|
29
|
+
top_p?: number;
|
|
30
|
+
max_tokens?: number;
|
|
31
|
+
stream?: boolean;
|
|
32
|
+
stop?: string | string[];
|
|
33
|
+
presence_penalty?: number;
|
|
34
|
+
frequency_penalty?: number;
|
|
35
|
+
user?: string;
|
|
36
|
+
seed?: number;
|
|
37
|
+
response_format?: {
|
|
38
|
+
type: 'text' | 'json_object';
|
|
39
|
+
};
|
|
40
|
+
tools?: Array<{
|
|
41
|
+
type: 'function';
|
|
42
|
+
function: {
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
parameters?: Record<string, unknown>;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
tool_choice?: 'none' | 'auto' | {
|
|
49
|
+
type: 'function';
|
|
50
|
+
function: {
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface ChatCompletionChoice {
|
|
56
|
+
index: number;
|
|
57
|
+
message: ChatMessage;
|
|
58
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | null;
|
|
59
|
+
}
|
|
60
|
+
export interface ChatCompletionUsage {
|
|
61
|
+
prompt_tokens: number;
|
|
62
|
+
completion_tokens: number;
|
|
63
|
+
total_tokens: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ChatCompletion {
|
|
66
|
+
id: string;
|
|
67
|
+
object: 'chat.completion';
|
|
68
|
+
created: number;
|
|
69
|
+
model: string;
|
|
70
|
+
choices: ChatCompletionChoice[];
|
|
71
|
+
usage?: ChatCompletionUsage;
|
|
72
|
+
system_fingerprint?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ChatCompletionChunkChoice {
|
|
75
|
+
index: number;
|
|
76
|
+
delta: Partial<ChatMessage>;
|
|
77
|
+
finish_reason: ChatCompletionChoice['finish_reason'];
|
|
78
|
+
}
|
|
79
|
+
export interface ChatCompletionChunk {
|
|
80
|
+
id: string;
|
|
81
|
+
object: 'chat.completion.chunk';
|
|
82
|
+
created: number;
|
|
83
|
+
model: string;
|
|
84
|
+
choices: ChatCompletionChunkChoice[];
|
|
85
|
+
}
|
|
86
|
+
export interface ModelInfo {
|
|
87
|
+
id: string;
|
|
88
|
+
object: 'model';
|
|
89
|
+
created: number;
|
|
90
|
+
owned_by: string;
|
|
91
|
+
/** Custom SIMO-side metadata. Optional — not all backends populate it. */
|
|
92
|
+
metadata?: {
|
|
93
|
+
region?: 'eu-central' | 'eu-west' | 'eu-north' | 'on-prem' | string;
|
|
94
|
+
sovereignty?: 'eu' | 'global';
|
|
95
|
+
pricing?: {
|
|
96
|
+
input_per_1m_tokens_eur?: number;
|
|
97
|
+
output_per_1m_tokens_eur?: number;
|
|
98
|
+
};
|
|
99
|
+
context_window?: number;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface ModelList {
|
|
103
|
+
object: 'list';
|
|
104
|
+
data: ModelInfo[];
|
|
105
|
+
}
|
|
106
|
+
export interface ApiKey {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
prefix: string;
|
|
110
|
+
/** Full token, only returned at creation time. */
|
|
111
|
+
token?: string;
|
|
112
|
+
created_at: string;
|
|
113
|
+
last_used_at?: string | null;
|
|
114
|
+
revoked_at?: string | null;
|
|
115
|
+
plan?: string;
|
|
116
|
+
scopes?: string[];
|
|
117
|
+
}
|
|
118
|
+
export interface CreateApiKeyRequest {
|
|
119
|
+
name: string;
|
|
120
|
+
scopes?: string[];
|
|
121
|
+
expires_at?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface UploadedFile {
|
|
124
|
+
id: string;
|
|
125
|
+
object: 'file';
|
|
126
|
+
bytes: number;
|
|
127
|
+
created_at: number;
|
|
128
|
+
filename: string;
|
|
129
|
+
purpose: 'assistants' | 'fine-tune' | 'batch' | 'user_data' | string;
|
|
130
|
+
/** Pre-signed download URL (TTL controlled by gateway). */
|
|
131
|
+
url?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface CreditBalance {
|
|
134
|
+
/** Remaining credits, expressed in micro-EUR (1 EUR = 1_000_000). */
|
|
135
|
+
balance_micro_eur: number;
|
|
136
|
+
/** Convenience: balance in EUR as a fixed-precision string. */
|
|
137
|
+
balance_eur: string;
|
|
138
|
+
currency: 'EUR';
|
|
139
|
+
plan?: string;
|
|
140
|
+
/** ISO-8601 timestamp the balance was last reconciled with billing. */
|
|
141
|
+
last_reconciled_at?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface UsageSummary {
|
|
144
|
+
from: string;
|
|
145
|
+
to: string;
|
|
146
|
+
total_requests: number;
|
|
147
|
+
total_input_tokens: number;
|
|
148
|
+
total_output_tokens: number;
|
|
149
|
+
total_cost_micro_eur: number;
|
|
150
|
+
by_model?: Array<{
|
|
151
|
+
model: string;
|
|
152
|
+
requests: number;
|
|
153
|
+
input_tokens: number;
|
|
154
|
+
output_tokens: number;
|
|
155
|
+
cost_micro_eur: number;
|
|
156
|
+
}>;
|
|
157
|
+
}
|
|
158
|
+
export interface RequestOptions {
|
|
159
|
+
/** Optional AbortSignal to cancel the request. */
|
|
160
|
+
signal?: AbortSignal;
|
|
161
|
+
/** Additional headers merged into the request. */
|
|
162
|
+
headers?: Record<string, string>;
|
|
163
|
+
/** Override the default fetch timeout (ms). */
|
|
164
|
+
timeoutMs?: number;
|
|
165
|
+
/** Idempotency-Key header value (for mutating requests). */
|
|
166
|
+
idempotencyKey?: string;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EACA,YAAY,GACZ,YAAY,GACZ,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,sBAAsB,GACtB,uBAAuB,GACvB,eAAe,GACf,cAAc,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;CAC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B,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;CACJ;AAID,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// Copyright (c) 2026 SIMO GmbH, Aschaffenburg, Germany.
|
|
3
|
+
//
|
|
4
|
+
// Public type surface for @simo-online/sdk. These types mirror the
|
|
5
|
+
// stable subset of the OpenAPI 3.1 spec published at
|
|
6
|
+
// https://api.simosphereai.com/openapi.json (version 2026-05-18).
|
|
7
|
+
//
|
|
8
|
+
// They are intentionally hand-written rather than codegen'd so the
|
|
9
|
+
// SDK stays free of upstream-generator churn and ships with friendly
|
|
10
|
+
// JSDoc. When the spec grows new shapes, extend the relevant
|
|
11
|
+
// interface here and bump the SDK minor version.
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,mEAAmE;AACnE,qDAAqD;AACrD,kEAAkE;AAClE,EAAE;AACF,mEAAmE;AACnE,qEAAqE;AACrE,6DAA6D;AAC7D,iDAAiD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simo-online/sdk",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Official TypeScript / JavaScript SDK for the SIMOSphere AI API — OpenAI-compatible chat/completions plus tenant admin (keys, usage, credits, files). Sovereign EU-hosted LLMs.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"type-check": "tsc --noEmit",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18.17"
|
|
26
|
+
},
|
|
27
|
+
"license": "BUSL-1.1",
|
|
28
|
+
"author": "SIMO GmbH <info@simo-online.com>",
|
|
29
|
+
"homepage": "https://onboarding.simosphereai.com",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/SIMOSphereOS/simosphere-ai-api-platform.git",
|
|
33
|
+
"directory": "sdk/typescript"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/SIMOSphereOS/simosphere-ai-api-platform/issues"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"simo",
|
|
40
|
+
"simosphere",
|
|
41
|
+
"sdk",
|
|
42
|
+
"ai",
|
|
43
|
+
"llm",
|
|
44
|
+
"openai-compatible",
|
|
45
|
+
"european-ai",
|
|
46
|
+
"sovereign-ai",
|
|
47
|
+
"dsgvo",
|
|
48
|
+
"gdpr"
|
|
49
|
+
],
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"typescript": "^5.4.0"
|
|
52
|
+
}
|
|
53
|
+
}
|