# Giky API Quickstart: Create Your First Generation

Create a key, check your balance, submit an image task and retrieve the generated file. The example uses the Seedream 5 Flash configuration verified through our website.

## 1. Create a key and check funds

Register and sign in. In API Keys, create a named key with a spending limit above the request price, and allow seedream-5-flash if you restrict models. An API key does not add balance. Check Balance & billing before submitting.

- [Create account](https://gikyapi.com/register/)
- [API keys](https://gikyapi.com/dashboard/keys/)
- [Balance & billing](https://gikyapi.com/dashboard/billing/)

## 2. Confirm the current configuration

Open the model page to check live availability and the current USD price. This example generates one 2K image. Do not substitute another resolution, add image inputs or batch parameters without checking that model’s contract.

- [Seedream 5 Flash: price and parameters](https://gikyapi.com/models/seedream-5-flash/)

## 3. Submit once

Run this in a terminal on your server with your own key. The request can incur a generation charge. Keep REQUEST_ID and the identical body if the connection fails before you receive a response.

```
export AI_API_BASE_URL="https://gikyapi.com"
export AI_API_KEY="YOUR_API_KEY"
# Generate once, then preserve this value for retries of this same request.
export REQUEST_ID="$(python3 -c 'import uuid; print(uuid.uuid4())')"
curl --fail-with-body --max-time 35 "$AI_API_BASE_URL/v1/tasks" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $REQUEST_ID" \
  --data '{
  "model": "seedream-5-flash",
  "operation": "text-to-image",
  "input": {
    "prompt": "A blue ceramic cup beside an orange, soft morning light",
    "resolution": "2K",
    "aspect_ratio": "1:1"
  }
}'
```

## 4. Save the task ID

HTTP 202 means the request was recorded, not that generation succeeded. The response includes id, status, outputs, error_code and timestamps. IDs below are illustrative; use your returned ID.

```
{
  "id": "00000000-0000-4000-8000-000000000001",
  "status": "queued",
  "outputs": [],
  "error_code": null,
  "created_at": "2026-11-02T00:00:00Z",
  "updated_at": "2026-11-02T00:00:00Z"
}
```

## 5. Query and save your file

Set TASK_ID to the returned ID. Query every five seconds or more using the same API key. When status is succeeded, outputs contains HTTPS file URLs. Download important files to storage you control; permanent hosting is not guaranteed.

```
export TASK_ID="YOUR_RETURNED_TASK_ID"
curl --fail-with-body "$AI_API_BASE_URL/v1/tasks/$TASK_ID" -H "Authorization: Bearer $AI_API_KEY"
```

## 6. Check the charge

Open Consumption history and compare the entry with the selected price. A failed task and a refund are separate records; allow settlement to complete. For an unclear outcome, retain the task ID instead of generating again.

- [Consumption history](https://gikyapi.com/dashboard/usage/)
- [Python submit-and-poll example](https://gikyapi.com/docs/python/)
- [JavaScript submit-and-poll example](https://gikyapi.com/docs/javascript/)
