Skip to content

API Definition

Endpoint List

Method Path Description
GET /api/v1/ping Health check
POST /api/v1/generation_logs Upload avatar data

GET /api/v1/ping

Checks that the server is running.

Response

{ "message": "pong" }
Status Code Description
200 OK Healthy

POST /api/v1/generation_logs

Receives prompt information and generated images from the Plabs AI server and saves them to S3.

Request Format

Content-Type: multipart/form-data
Field Type Required Description
log_id string โœ“ Unique identifier for the generation log
generated_at integer (Unix timestamp) โœ“ Generation timestamp (seconds since epoch). Example: 1710504000
prompt string (JSON) โœ“ Plabs-defined prompt as a JSON string
image binary โœ“ Generated avatar image (JPG)

Response

Success

Status Code Body Description
200 OK (empty) Both prompt and image saved to S3 successfully

Error

Status Code Body Description
400 Bad Request { "error": "<message>" } Missing required field or invalid format
500 Internal Server Error { "error": "<message>" } Internal error such as S3 save failure

For error details, see Error Handling.

S3 Storage Path

The path is determined by combining generated_at (converted to UTC) and log_id.

{yyyy}/{mm}/{dd}/{log_id}/prompt.json
{yyyy}/{mm}/{dd}/{log_id}/image.jpg

Processing Flow

sequenceDiagram
    participant Plabs as Plabs AI Server
    participant APIGW as API Gateway
    participant Lambda
    participant S3

    Plabs->>APIGW: POST /api/v1/generation_logs
    APIGW->>Lambda: Proxy request
    Lambda->>Lambda: Parse request & determine S3 path<br/>(log_id + generated_at โ†’ {yyyy}/{mm}/{dd}/{log_id}/)
    Lambda->>S3: PUT prompt.json
    S3-->>Lambda: 200 OK
    Lambda->>S3: PUT image.jpg
    S3-->>Lambda: 200 OK
    Lambda-->>APIGW: 200 OK
    APIGW-->>Plabs: 200 OK