File size: 7,854 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
###
# @name Upload a JSONL file for batch processing
POST {{omniroute-address}}/v1/files
Authorization: Bearer {{OMNIROUTE_API_KEY}}
Content-Type: multipart/form-data; boundary=boundary

--boundary
Content-Disposition: form-data; name="file"; filename="batch_input.jsonl"
Content-Type: application/jsonl

{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-4o-mini", "messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello world!"}], "max_tokens": 50}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gemini/gemma-4-31b-it", "messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is 2+2?"}], "max_tokens": 50}}

--boundary
Content-Disposition: form-data; name="purpose"

batch
--boundary--

> {%
    client.global.set("file_id", response.body.id);
%}

###
# @name Upload a JSONL file for batch processing - test embedding endpoint
POST {{omniroute-address}}/v1/files
Authorization: Bearer {{OMNIROUTE_API_KEY}}
Content-Type: multipart/form-data; boundary=boundary

--boundary
Content-Disposition: form-data; name="file"; filename="batch_input.jsonl"
Content-Type: application/jsonl

{"custom_id": "request-1", "method": "POST", "url": "/v1/embeddings", "body": {"model": "pinecone/llama-text-embed-v2", "input": "The food was delicious and the waiter was very attentive."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "The food was delicious and the waiter was very attentive."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "I had a terrible experience at the restaurant. The food was cold and the service was slow."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "Too bad! The food was cold and the service was slow."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "Best dining experience ever! The food was amazing and the waiter was super friendly."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "All you can eat buffet was a disaster. The food was stale and the staff was rude."}}
{"custom_id": "request-2", "method": "POST", "url": "/v1/embeddings", "body": {"model": "mistral/mistral-embed", "input": "All your base are belong to us."}}

--boundary
Content-Disposition: form-data; name="purpose"

batch
--boundary--

> {%
    client.global.set("file_id", response.body.id);
%}

###
# @name Upload a JSONL file for batch processing - batch test with long input for embedding endpoint
POST {{omniroute-address}}/v1/files
Authorization: Bearer {{OMNIROUTE_API_KEY}}
Content-Type: multipart/form-data; boundary=boundary

--boundary
Content-Disposition: form-data; name="file"; filename="batch_input.jsonl"
Content-Type: application/jsonl

{"custom_id":"0","method":"POST","url":"/v1/embeddings","body":{"model":"mistral/mistral-embed","input":"# Lorem Ipsum\n\n## Index (use lorem to find dolor)\n- **Sit**: amet.md\n- **Consectetur**: adipiscing.md\n- **Elit**: elit.md\n- **Sed**: sed.md\n- **Do**: eiusmod-insights.md (evergreen behavioral profile)\n- **Tempor**: tempor-plan.md\n- **Technical notes**: See daily logs in `logs/YYYY-MM-DD.md` (search with `search_tool`)\n\n## Project Goal: The Lorem Ipsum Dolor\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n## Durable preferences / facts\n- Running directly on `dev-server-01` (no SSH required for local scripts).\n- Date-stamped log files decay (half-life ~30 days). Undated files never decay.\n- **Always write it down**: Use `logs/YYYY-MM-DD.md` for daily logs; rely on `README.md` only for evergreen facts.\n- Use `search_tool` to locate information across README.md and dated logs before answering questions about prior work, decisions, or todos.\n- When searching it may also be that you should search online using the web skill.\n- **Embeddings**: Use Mistral embedding endpoint (`https://api.mistral.ai/v1/embeddings`, model: `mistral-embed`) with `MISTRAL_API_KEY`. Verified working on 2026-04-18.\n\n## Code Examples\n```typescript\nconst lorem = \"ipsum dolor\";\nconsole.log(lorem);\n```\n\n## Special Characters Test: \"quotes\", 'apostrophes', `backticks`, \\backslashes\\, \\n newlines, \\t tabs, & ampersands, <tags>, ${interpolation}, .\n\n## Unicode: café, naïve, 🚀 rocket, 中文, 日本語, 한국어."}}

--boundary
Content-Disposition: form-data; name="purpose"

batch
--boundary--

> {%
    client.global.set("file_id", response.body.id);
%}

###

# @name List all uploaded files
GET {{omniroute-address}}/v1/files
Authorization: Bearer {{OMNIROUTE_API_KEY}}

> {%
    client.global.set("file_id", response.body.data[0].id);
%}

###
# @name Get file metadata of the uploaded file
GET {{omniroute-address}}/v1/files/{{file_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Create a new batch job
POST {{omniroute-address}}/v1/batches
Authorization: Bearer {{OMNIROUTE_API_KEY}}
Content-Type: application/json

{
  "input_file_id": "{{file_id}}",
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h"
}

> {%
    client.global.set("batch_id", response.body.id);
%}

###
# @name Create a new batch job for embeddings
POST {{omniroute-address}}/v1/batches
Authorization: Bearer {{OMNIROUTE_API_KEY}}
Content-Type: application/json

{
  "input_file_id": "{{file_id}}",
  "endpoint": "/v1/embeddings",
  "completion_window": "24h"
}

> {%
    client.global.set("batch_id", response.body.id);
%}

###
# @name List all uploaded files
GET {{omniroute-address}}/v1/files
Authorization: Bearer {{OMNIROUTE_API_KEY}}

> {%
    client.global.set("file_id", response.body.data[0].id);
%}

###
# @name Get file metadata of the uploaded file
GET {{omniroute-address}}/v1/files/{{file_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name List all batch jobs
GET {{omniroute-address}}/v1/batches
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Get status of batch job
GET {{omniroute-address}}/v1/batches/{{batch_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}

> {%
    if (response.body.output_file_id) {
        client.global.set("output_file_id", response.body.output_file_id);
    }
    if (response.body.error_file_id) {
        client.global.set("error_file_id", response.body.error_file_id);
    }
%}

###
# @name Cancel batch job
POST {{omniroute-address}}/v1/batches/{{batch_id}}/cancel
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Get outputfile contents
GET {{omniroute-address}}/v1/files/{{output_file_id}}/content
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Get outputfile metadata
GET {{omniroute-address}}/v1/files/{{output_file_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Get errorfile contents
GET {{omniroute-address}}/v1/files/{{error_file_id}}/content
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Get errorfile metadata
GET {{omniroute-address}}/v1/files/{{error_file_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}

###
# @name Delete File
DELETE {{omniroute-address}}/v1/files/{{file_id}}
Authorization: Bearer {{OMNIROUTE_API_KEY}}