Segmind Storage

Segmind Storage allows you to upload files as assets and get URLs that can be used with other models. This is particularly useful when you need to provide image inputs to various AI models without repeatedly uploading the same file.

Upload Asset API

Upload files to Segmind Storage and receive a URL that can be used across different models.

Endpoint

POST https://workflows-api.segmind.com/upload-asset

Headers

Header
Value
Required
Description

accept

application/json, text/plain, */*

Yes

Accepted response types

x-api-key

SG_XXX

Yes

Your Segmind API key

content-type

application/json

Yes

Request content type

Request Body

The request body should be a JSON object with the following structure:

{
  "data_urls": ["data:image/jpeg;base64,..."]
}
Field
Type
Description

data_urls

Array of strings

Array of base64-encoded data URLs for the files to upload

Data URL Format

Files should be provided as base64-encoded data URLs in the format:

data:<mime-type>;base64,<base64-encoded-content>

Supported formats include:

  • Images: data:image/jpeg;base64,, data:image/png;base64,, data:image/webp;base64,

  • Other file types as supported by the models you intend to use

Code Examples

Upload files to Segmind Storage using your preferred programming language.

curl 'https://workflows-api.segmind.com/upload-asset' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'x-api-key: SG_YOUR_API_KEY_HERE' \
  -H 'content-type: application/json' \
  --data-raw '{"data_urls":["data:image/jpeg;base64,/9j/4AAQSkZJRg..."]}'

Response

The API returns a JSON response containing the URLs of the uploaded assets:

{
  "urls": [
    "https://storage.segmind.com/assets/..."
  ]
}

These URLs can then be used as inputs for various models on the Segmind platform.

Use Cases

  1. Reusable Image Inputs: Upload an image once and use the URL across multiple model runs

  2. Batch Processing: Upload multiple images and process them with different models

  3. Workflow Integration: Use uploaded assets in PixelFlow workflows

  4. Model Chaining: Pass asset URLs between different models in a pipeline

Best Practices

  • Store the returned URLs for reuse to avoid uploading the same file multiple times

  • Ensure your base64 encoding is correct to prevent upload failures

  • Use appropriate MIME types in your data URLs for proper file handling

  • Keep your API key secure and never expose it in client-side code

Rate Limits

Asset uploads are subject to the standard Segmind API rate limits. Refer to the Rate Limits documentation for more information.

Last updated