kaiwa API (1.0.0)

Download OpenAPI specification:Download

Use kaiwa to create freely

mosaic

Execute AI commands

Use text-to-image services

You can use this service to generate images from text

Authorizations:
api_key
Request Body schema: application/json
required

The usual response

prompt
string

Invoke the prompt used by the AI model

seed
integer

The random number seed used by the AI model is invoked

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "seed": 0
}

kaiwa

Invoking AI model

use llama3-7b

llama3-7b was selected as the machine learning model.

Authorizations:
api_key
Request Body schema: application/json
required

The usual response

prompt
string

Invoke the prompt used by the AI model

seed
integer

The random number seed used by the AI model is invoked

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "seed": 0
}

Response samples

Content type
application/json
{
  • "model": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "response": "string"
}

use mistral-7b

mistral-7b was selected as the machine learning model

Authorizations:
api_key

Responses

Request samples

from datetime import datetime
import requests

from pydantic import BaseModel

class defRequestBody(BaseModel):
    prompt: str
    seed: int

class defResponse(BaseModel):
    model: str
    created_at: datetime
    response: str

response: defResponse = requests.post(
    url = 'https://api.kaiwa.dev/v1/kaiwa/mistral-7b',
    headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer <YOUR_API_KEY>'},
    data = defRequestBody(
        prompt = 'Hello, how are you?',
        seed = 42).model_dump_json()
    )
print(response['response'])

Response samples

Content type
application/json
{
  • "model": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "response": "string"
}