Image Management

The Vision API provides endpoints for managing images in your account. You can upload images for indexing, retrieve image details, list images with filters, and delete images when no longer needed. While video search is ideal for more complex use cases that require video context and understanding, for the majority of simple use cases, image upload and search has similiar accuracy to video search but with significantly faster processing and lower costs.

Upload Images

Upload one or more images to your account with optional indexing.

Endpoint

  • POST /images/upload

Request

Bash

$curl -X POST https://vision-agent.api.reka.ai/images/upload \
> -H "X-Api-Key: YOUR_API_KEY" \
> -F "images=@/path/to/image1.jpg" \
> -F "images=@/path/to/image2.jpg" \
> -F 'metadata={"requests":[{"indexing_config":{"index":true},"metadata":{}},{"indexing_config":{"index":true},"metadata":{}}]}'

Python

1import requests
2import json
3import io
4
5url = f"{BASE_URL}/images/upload"
6headers = {
7 "X-Api-Key": REKA_API_KEY
8}
9images = [get_image() for _ in range(10)]
10metadata = {
11 "requests": [
12 {
13 "indexing_config": {"index": True},
14 "metadata": {}
15 } for i in range(len(images))
16 ]
17}
18
19# Prepare files and data
20files = []
21for i, image in enumerate(images):
22 file_obj = io.BytesIO(image)
23 files.append(
24 ('images', (f'test_image_{i}.jpg', file_obj, 'image/jpeg'))
25 )
26data = {'metadata': json.dumps(metadata)}
27
28# Make request
29response = requests.post(
30 url,
31 files=files,
32 data=data,
33)
34if response.status_code == 200:
35 result = response.json()
36 print("Upload successful:", result)
37else:
38 raise ValueError(
39 "Error:", response.status_code, response.text
40 )

Parameters

  • images (required): Image file(s) to upload
  • metadata (optional): JSON object containing configuration for each image:
    • indexing_config: Configuration for indexing
      • index: Boolean indicating whether to index the image
    • metadata: Custom metadata for the image

Response

Returns an array of image upload results with:

  • image_id: Unique identifier for the uploaded image
  • image_url: URL to access the uploaded image
  • indexing_status: Indexing status (1 = indexing in progress, 2 = indexed)
  • image_metadata: Custom metadata fields for the image
  • upload_timestamp: Unix timestamp of when the image was uploaded

Get Images

Retrieve details for specific images by their IDs.

Endpoint

  • POST /images/get

Request

Bash

$curl -X POST https://vision-agent.api.reka.ai/images/get \
> -H "X-Api-Key: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "image_ids": ["550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001"]
> }'

Python

1import requests
2
3url = f"{BASE_URL}/images/get"
4payload = {
5 "image_ids": image_ids,
6}
7headers = {
8 "X-Api-Key": REKA_API_KEY
9}
10response = requests.post(url, json=payload, headers=headers)

Parameters

  • image_ids (required): Array of image IDs to retrieve

Response

Returns an array of image objects with the same structure as the upload response.

List Images

List images in your account with optional filtering and pagination.

Endpoint

  • POST /images/list

Request

Bash

$curl -X POST https://vision-agent.api.reka.ai/images/list \
> -H "X-Api-Key: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "limit": 20,
> "offset": 0,
> "filters": {
> "recorded_timestamp_utc": {
> "operator": "range",
> "value": {
> "_from": 1750099229,
> "_to": 1750099229
> }
> }
> }
> }'

Python

1url = f"{BASE_URL}/images/list"
2payload = {
3 "limit": 20,
4 "offset": 0,
5 "filters": {
6 "recorded_timestamp_utc": {
7 "operator": "range",
8 "value": {
9 "_from": 1750099229,
10 "_to": 1750099229
11 }
12 },
13 }
14}
15headers = {
16 "X-Api-Key": REKA_API_KEY
17}
18response = requests.post(url, json=payload, headers=headers)

Parameters

  • limit (optional): Maximum number of images to return
  • offset (optional): Number of images to skip for pagination
  • filters (optional): Filter criteria for images:
    • recorded_timestamp_utc: Filter by timestamp
      • operator: Filter operator (e.g., “range”)
      • value: Filter values
        • _from: Start timestamp
        • _to: End timestamp

Response

Returns a paginated array of images matching the filter criteria, with the same structure as the upload and get responses.

Delete Images

Delete one or more images from your account.

Endpoint

  • POST /images/delete

Request

Bash

$curl -X POST https://vision-agent.api.reka.ai/images/delete \
> -H "X-Api-Key: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "image_ids": ["550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001"]
> }'

Python

1import requests
2
3url = f"{BASE_URL}/images/delete"
4payload = {
5 "image_ids": image_ids, # an array of image ids
6}
7headers = {
8 "X-Api-Key": REKA_API_KEY
9}
10response = requests.post(url, json=payload, headers=headers)
11# Check the response
12if response.status_code == 200:
13 result = response.json()
14 print("Delete successful:", result)
15else:
16 raise ValueError("Error:", response.status_code, response.text)

Parameters

  • image_ids (required): Array of image IDs to delete

Response

Returns a confirmation message indicating the images were deleted successfully.