-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathopenapi.yaml
More file actions
717 lines (672 loc) · 21.2 KB
/
Copy pathopenapi.yaml
File metadata and controls
717 lines (672 loc) · 21.2 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
openapi: 3.1.0
info:
title: lixSearch API
description: |
**lixSearch** is an intelligent search assistant that searches the web, fetches content,
and synthesizes answers with cited sources.
## Authentication
All endpoints (except `/api/health`, `/docs`, `/v1/models`) require an API key:
| Method | Example |
|--------|---------|
| Bearer token (recommended) | `Authorization: Bearer <key>` |
| Header | `X-API-Key: <key>` |
| Query param (GET only) | `?key=<key>` |
Missing key returns `401`. Invalid key returns `403`.
## Quick Start
```bash
# Simple search (POST)
curl -X POST https://search.elixpo.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "What is quantum computing?"}]}'
# Simple search (GET)
curl "https://search.elixpo.com/api/search?query=quantum+computing&key=YOUR_API_KEY"
# With image
curl -X POST https://search.elixpo.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": [
{"type": "text", "text": "What is this?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]}]}'
# Streaming
curl -X POST https://search.elixpo.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Latest AI news"}], "stream": true}'
```
## Sessions
Pass `session_id` to persist conversation context across requests.
Without it, each request is stateless (ephemeral session, no history saved).
## Images
Pass images in the `content` array using OpenAI vision format:
- **URL**: `{"type": "image_url", "image_url": {"url": "https://..."}}`
- **Base64**: `{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}}`
Base64 images are auto-hosted on the server. Up to 3 images per request.
## Deep Search
Complex queries automatically trigger deep research mode — no flag needed.
The pipeline decomposes the query into sub-topics and synthesizes a comprehensive answer.
version: 3.0.0
contact:
name: Elixpo
url: https://elixpo.com
license:
name: MIT
servers:
- url: https://search.elixpo.com
description: Production
tags:
- name: Chat
description: Search and chat — text, images, streaming, multi-turn conversations
- name: Surf
description: Lightweight search — raw URLs and images, no LLM synthesis
- name: Sessions
description: Session lifecycle — create, read, delete conversation sessions
- name: Media
description: Hosted files — images and PDFs referenced in chat responses
- name: System
description: Health and models
security:
- BearerAuth: []
- ApiKeyHeader: []
- ApiKeyQuery: []
paths:
# ─── Chat ───────────────────────────────────────────
/v1/chat/completions:
post:
operationId: chat
summary: Chat (POST)
description: |
Primary endpoint. OpenAI-compatible — works with any OpenAI SDK client.
- Last user message is used as the search query
- Earlier messages provide conversation context
- `stream` defaults to `false`
- `session_id` is optional (omit for stateless usage)
tags: [Chat]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatRequest'
examples:
text:
summary: Simple text query
value:
messages:
- role: user
content: "What is quantum computing?"
streaming:
summary: Streaming response
value:
messages:
- role: user
content: "Latest developments in AI"
stream: true
multi_turn:
summary: Multi-turn with session
value:
messages:
- role: user
content: "Tell me about Tokyo"
- role: assistant
content: "Tokyo is the capital of Japan..."
- role: user
content: "What about the food scene there?"
session_id: "my-session-123"
image_url:
summary: Image input (URL)
value:
messages:
- role: user
content:
- type: text
text: "Classify this image"
- type: image_url
image_url:
url: "https://example.com/photo.jpg"
image_base64:
summary: Image input (base64)
value:
messages:
- role: user
content:
- type: text
text: "Describe this image"
- type: image_url
image_url:
url: "data:image/jpeg;base64,/9j/4AAQ..."
image_only:
summary: Image only (no text)
value:
messages:
- role: user
content:
- type: image_url
image_url:
url: "https://example.com/photo.jpg"
responses:
'200':
description: Chat response
content:
application/json:
schema:
$ref: '#/components/schemas/ChatResponse'
text/event-stream:
schema:
description: "SSE stream of chat.completion.chunk objects, terminated by data: [DONE]"
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'503':
$ref: '#/components/responses/NotInitialized'
/api/search:
get:
operationId: searchGet
summary: Search (GET)
description: |
Simple GET endpoint for quick searches. Returns the same quality results as the POST endpoint.
Use `stream=true` for SSE streaming, or omit for a single JSON response.
Pass `session_id` for multi-turn context.
tags: [Chat]
parameters:
- name: query
in: query
required: true
schema:
type: string
description: Search query
example: "latest AI news"
- name: stream
in: query
schema:
type: boolean
default: false
description: Enable SSE streaming
- name: session_id
in: query
schema:
type: string
description: Session ID for multi-turn context (optional)
- name: image
in: query
schema:
type: string
format: uri
description: Image URL to analyze alongside the query
- name: key
in: query
schema:
type: string
description: API key (alternative to Authorization header)
responses:
'200':
description: Search response
content:
application/json:
schema:
$ref: '#/components/schemas/ChatResponse'
text/event-stream:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
# ─── Surf ────────────────────────────────────────────
/api/surf:
get:
operationId: surf
summary: Surf
description: |
Lightweight search — returns raw URLs and optionally image URLs.
No LLM synthesis, no answer generation. Fast.
tags: [Surf]
parameters:
- name: query
in: query
required: true
schema:
type: string
description: Search query
- name: limit
in: query
schema:
type: integer
default: 5
minimum: 1
maximum: 20
description: Max results to return
- name: images
in: query
schema:
type: boolean
default: false
description: Include image search results
- name: key
in: query
schema:
type: string
description: API key
responses:
'200':
description: Search results
content:
application/json:
schema:
$ref: '#/components/schemas/SurfResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
# ─── Sessions ───────────────────────────────────────
/api/session/create:
get:
operationId: createSession
summary: Create session
description: |
Create a new named session. Returns a `session_id` that can be passed
to `/v1/chat/completions` or `/api/search` for multi-turn context.
tags: [Sessions]
parameters:
- name: query
in: query
required: true
schema:
type: string
description: Initial query / session topic
example: "Research on quantum computing"
responses:
'201':
description: Session created
content:
application/json:
schema:
type: object
properties:
session_id:
type: string
query:
type: string
created_at:
type: string
format: date-time
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
/api/session/{session_id}:
get:
operationId: getSession
summary: Get session and chat history
description: Returns session info and full conversation history (messages array).
tags: [Sessions]
parameters:
- $ref: '#/components/parameters/SessionId'
responses:
'200':
description: Session info
content:
application/json:
schema:
type: object
properties:
session_id:
type: string
query:
type: string
summary:
type: object
properties:
messages:
type: array
items:
type: object
conversation_turns:
type: integer
'404':
$ref: '#/components/responses/SessionNotFound'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
delete:
operationId: deleteSession
summary: Delete session
description: Permanently deletes a session and its conversation history.
tags: [Sessions]
parameters:
- $ref: '#/components/parameters/SessionId'
responses:
'200':
description: Session deleted
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Session deleted"
session_id:
type: string
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
# ─── System ─────────────────────────────────────────
/api/models:
get:
operationId: listModels
summary: List models
description: |
Returns available models. Currently returns `lixsearch`.
Also available at `/v1/models` for OpenAI SDK compatibility.
tags: [System]
security: []
responses:
'200':
description: Model list
content:
application/json:
schema:
type: object
properties:
object:
type: string
const: list
data:
type: array
items:
type: object
properties:
id:
type: string
example: lixsearch
object:
type: string
const: model
owned_by:
type: string
example: elixpo
/api/health:
get:
operationId: healthCheck
summary: Health check
description: Returns service status. No auth required.
tags: [System]
security: []
responses:
'200':
description: Healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
# ─── Images ─────────────────────────────────────────
/api/image/{image_id}:
get:
operationId: getImage
summary: Get image
description: |
Serves a hosted image by ID. Images are created when:
- The model generates an image via `create_image` tool
- A base64 image is uploaded through `/v1/chat/completions`
Images have a 7-day TTL and are cleaned up automatically. No auth required.
tags: [Media]
security: []
parameters:
- name: image_id
in: path
required: true
schema:
type: string
description: Image identifier (UUID)
responses:
'200':
description: Image file
content:
image/png:
schema:
type: string
format: binary
image/jpeg:
schema:
type: string
format: binary
'404':
description: Image not found
/api/content/{content_id}:
get:
operationId: getContent
summary: Get content
description: |
Serves hosted content (PDFs, documents) by ID. Content is created when
the model generates a PDF via the `export_to_pdf` tool during a chat response.
The response will contain a link like `https://search.elixpo.com/api/content/{id}`.
Content has a 7-day TTL and is cleaned up automatically. No auth required.
tags: [Media]
security: []
parameters:
- name: content_id
in: path
required: true
schema:
type: string
description: Content identifier (UUID)
responses:
'200':
description: Content file (typically PDF)
content:
application/pdf:
schema:
type: string
format: binary
'404':
description: Content not found
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: "`Authorization: Bearer <key>`"
ApiKeyHeader:
type: apiKey
in: header
name: X-API-Key
description: "`X-API-Key: <key>`"
ApiKeyQuery:
type: apiKey
in: query
name: key
description: "`?key=<key>` (GET requests)"
parameters:
SessionId:
name: session_id
in: path
required: true
schema:
type: string
description: Session identifier
example: "sess-a1b2c3d4"
schemas:
ChatMessage:
type: object
required: [role, content]
properties:
role:
type: string
enum: [system, user, assistant]
content:
oneOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ContentPart'
description: "Vision format: array of text and image_url parts"
ContentPart:
type: object
required: [type]
properties:
type:
type: string
enum: [text, image_url]
text:
type: string
description: Text content (when type is "text")
image_url:
type: object
properties:
url:
type: string
description: |
HTTPS URL or base64 data URI (`data:image/jpeg;base64,...`).
Base64 images are auto-hosted before processing.
description: Image reference (when type is "image_url")
ChatRequest:
type: object
required: [messages]
properties:
messages:
type: array
items:
$ref: '#/components/schemas/ChatMessage'
minItems: 1
description: Conversation messages. Last user message = search query.
model:
type: string
description: Ignored — always uses lixsearch
default: lixsearch
stream:
type: boolean
default: false
description: Enable SSE streaming
session_id:
type: string
description: |
Session ID for multi-turn context persistence.
Omit for stateless (ephemeral) requests.
temperature:
type: number
description: Accepted for compatibility, not used
max_tokens:
type: integer
description: Accepted for compatibility, not used
ChatResponse:
type: object
properties:
id:
type: string
example: "elixpo-abc123"
object:
type: string
const: chat.completion
created:
type: integer
model:
type: string
example: lixsearch
choices:
type: array
items:
type: object
properties:
index:
type: integer
message:
type: object
properties:
role:
type: string
const: assistant
content:
type: string
finish_reason:
type: string
enum: [stop]
usage:
type: object
properties:
prompt_tokens:
type: integer
completion_tokens:
type: integer
total_tokens:
type: integer
SurfResponse:
type: object
properties:
urls:
type: array
items:
type: string
format: uri
description: Web search result URLs
query:
type: string
images:
type: array
items:
type: string
format: uri
description: Image URLs (only when images=true)
Error:
type: object
properties:
error:
type: string
responses:
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "Invalid or missing query"
Unauthorized:
description: API key required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "API key required. Pass via Authorization: Bearer <key>, X-API-Key header, or ?key= param"
Forbidden:
description: Invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "Invalid API key"
SessionNotFound:
description: Session not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "Session not found"
NotInitialized:
description: Server not ready
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: "Server not initialized"