Stability Remove Background

Developer documentation

Stability Remove Background

Stability AI background removal that preserves the foreground subject.

Model Reference

Image generation and editing models

Prompt-to-image, image editing, image merging, upscaling, and background removal. Endpoint: http://omixa.cloud/api/v1/images/generations

Stability Remove Background

stability-remove-background

Stability AI background removal that preserves the foreground subject.

Image
image per unit $0.050000
minimum hold $0.010000
Integration reference

Connect Stability Remove Background

Use Omixa's unified endpoint and your workspace API key. Provider routing, billing, failover, and usage records are handled by Omixa.

POST http://omixa.cloud/api/v1/images/generations
  • Provider: stability
  • Endpoint type: stability_image_edit
Request schema

Request fields

Only send options supported by this model. Required fields and accepted values are listed below.

Field Type Required Accepted values Description
model string Yes stability-remove-background Use `stability-remove-background`. Omixa resolves the active provider route and failover key automatically.
model string Yes Any valid value The Omixa Stability tool slug.
input_images array Yes Any valid value Exactly one inline PNG, JPG, or WebP source image. Use `{type:"image_url", image_url:{url:"data:image/png;base64,..."}}`.
output_format string No png, webp Preferred output file format.
Ready to send

Payload and response

Start with this model-safe payload and expect the normalized Omixa response shape shown beside it.

Example JSON payload
{
    "model": "stability-remove-background",
    "output_format": "png",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-image>"
            }
        }
    ]
}
Response shape
{
    "created": 1780660800,
    "data": [
        {
            "b64_json": "<base64-image>",
            "url": null
        }
    ],
    "usage": {
        "billed_amount": "0.039000"
    }
}
Language examples

Copy-ready integration code

Replace the example API key with a workspace key and keep model-specific fields unchanged unless the table above marks them optional.

cURL
curl -X POST http://omixa.cloud/api/v1/images/generations \
  -H "Authorization: Bearer omx_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "stability-remove-background",
    "output_format": "png",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-image>"
            }
        }
    ]
}'
JavaScript fetch
const response = await fetch('http://omixa.cloud/api/v1/images/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer omx_live_xxx',
    'Content-Type': 'application/json'
  },
  body: "{\n    \"model\": \"stability-remove-background\",\n    \"output_format\": \"png\",\n    \"input_images\": [\n        {\n            \"type\": \"image_url\",\n            \"image_url\": {\n                \"url\": \"data:image/png;base64,<base64-image>\"\n            }\n        }\n    ]\n}"
});
const data = await response.json();
Python requests
import requests

response = requests.post(
    'http://omixa.cloud/api/v1/images/generations',
    headers={'Authorization': 'Bearer omx_live_xxx', 'Content-Type': 'application/json'},
    json={
    "model": "stability-remove-background",
    "output_format": "png",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-image>"
            }
        }
    ]
}
)
print(response.json())
PHP cURL
$ch = curl_init('http://omixa.cloud/api/v1/images/generations');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer omx_live_xxx', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{
    "model": "stability-remove-background",
    "output_format": "png",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-image>"
            }
        }
    ]
}',
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
C# HttpClient
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "omx_live_xxx");
var json = @"{
    ""model"": ""stability-remove-background"",
    ""output_format"": ""png"",
    ""input_images"": [
        {
            ""type"": ""image_url"",
            ""image_url"": {
                ""url"": ""data:image/png;base64,<base64-image>""
            }
        }
    ]
}";
var response = await client.PostAsync("http://omixa.cloud/api/v1/images/generations", new StringContent(json, System.Text.Encoding.UTF8, "application/json"));
var body = await response.Content.ReadAsStringAsync();
Go net/http
payload := []byte(`{
    "model": "stability-remove-background",
    "output_format": "png",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-image>"
            }
        }
    ]
}`)
req, _ := http.NewRequest("POST", "http://omixa.cloud/api/v1/images/generations", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer omx_live_xxx")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Production checklist

Operational notes

  • Authenticate with `Authorization: Bearer omx_live_xxx`.
  • Omixa handles provider keys, routing, billing, failover, and usage recording behind this endpoint.
  • For edits and reference workflows, send inline image data URLs. Omixa does not fetch arbitrary remote image URLs for providers that require inline media.
Copied Markdown