Introduction
Welcome to the Lukaz API, a generative AI for study and work! You can use this API to develop an application based on Lukaz. In this reference, you can find some code examples in JavaScript
and in bash
.
Installation
You can install Lukaz with the following command:
npm i @lukaz/client
Or just use our HTTP endpoints described in this reference.
Base URLs
Production Environment
https://europe-west1-lukaz-api.cloudfunctions.net
Development Environment
https://europe-west1-lukaz-dev.cloudfunctions.net
Create an account on the dev UI: lukaz.dev
Set the dev environment on the JS client by passing dev
in the second parameter like this: new client('<API_KEY>', 'dev')
Authentication
Lukaz uses API keys to allow access to the API. You can create a new API key on the settings page under security options.
The API key should be included in all requests to the server in a header that looks like the following:
x-api-key: <API_KEY>
Send a valid API key in the header for every request:
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const boards = await lukaz.getBoards()
console.log(boards)
curl "https://<BASE_URL>/<ENDPOINT>" \
-H "x-api-key: <API_KEY>" \
-X POST
Make sure to replace
<API_KEY>
with your API key.
Get Authenticated User
This endpoint retrieves the user data related to the API key in use.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const user = await lukaz.getUser()
console.log(user)
curl "https://<BASE_URL>/user" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
{
"displayName": "Example User",
"email": "user@example.com",
"photoURL": "https://example.com/Photo_File.jpg",
"quota": {
"prompts": 1000,
"boards": 10
},
"savedPrompts": ["<ID>", "<ID>"],
"usage": {
"prompts": 834,
"boards": 7
}
}
HTTP Request
GET https://<BASE_URL>/user
HTTP Response Body
Property | Description |
---|---|
createdAt | Timestamp of the creation |
displayName | User's display name |
Email address | |
photoURL | URL of the profile photo |
quota | Quota related to the subscription plan |
savedPrompts | Array of IDs of user's favorite prompts |
usage | Usage of the current billing period |
User Quota
Property | Description |
---|---|
prompts | Number of prompts / month allowed |
boards | Number of boards allowed |
Plan Usage
Property | Description |
---|---|
prompts | Current number of prompts submitted |
boards | Number of boards created |
Boards
Create New Board
This endpoint creates a new board. A board is basically a collection of prompts, their results and documents uploaded as context. It can be shared with other users or made publicly available.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const board = await lukaz.createBoard({
description: 'My custom AI board.',
options: {
behavior: 'Content generator',
docs: false,
free: false,
prompt: true,
public: false,
upload: true,
voice: 'onyx'
},
title: 'My AI Board'
})
console.log(board)
curl "https://<BASE_URL>/board" \
-d '
{
"description": "My custom AI board.",
"options": {
"behavior": "Content generator",
"docs": false,
"free": false,
"prompt": true,
"public": false,
"upload": true,
"voice": "onyx"
},
"title": "My AI Board"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
{
"boardId": "my-ai-board-xyz123"
}
HTTP Request
POST https://<BASE_URL>/board
HTTP Request Body
Property | Description |
---|---|
description | Descripton of the board |
options | Options of the board |
title | Title of the board |
Board Options
Property | Description |
---|---|
behavior | Description of the board's behavior |
docs | Documents shown/hidden on board |
free | Prompting free/paid |
prompt | Prompting enabled/disabled |
public | Board access public/private |
upload | File upload enabled/disabled |
voice | alloy, echo, fable, onyx, nova, schimmer |
HTTP Response Body
Property | Description |
---|---|
boardId | ID of the created board |
Get Board
This endpoint retrieves a board.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const board = await lukaz.getBoard('<BOARD_ID>')
console.log(board)
curl "https://<BASE_URL>/board/<BOARD_ID>" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
{
"createdAt": "2023-01-31T18:10:54.376Z",
"description": "My custom AI board.",
"documents": [
{
"createdAt": "2023-01-31T18:10:54.376Z",
"extension": "pdf",
"name": "Text_File.pdf",
"processed": true,
"url": "https://example.com/Text_File.pdf"
}
],
"id": "<BOARD_ID>",
"ownerEmail": "owner@example.com",
"options": {
"behavior": "Content generator",
"docs": false,
"free": false,
"prompt": true,
"public": false,
"upload": true,
"voice": "onyx"
},
"roles": {
"owner@example.com": 5,
"user@example.com": 4
},
"stats": {
"docs": 2,
"prompts": 7,
"results": 5
},
"title": "My AI Board",
"updatedAt": "2023-01-31T18:10:54.376Z"
}
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to retrieve |
HTTP Request
GET https://<BASE_URL>/board/<BOARD_ID>
HTTP Response Body
Property | Description |
---|---|
createdAt | Timestamp of the creation |
description | Description of the board |
documents | Documents uploaded to the board |
id | The ID of the board |
ownerEmail | Email address of the board's owner |
options | Options of the board |
roles | Users emails with their roles |
stats | Statistics of the board |
title | Title of the board |
updatedAt | Timestamp of the last update |
Documents
Property | Description |
---|---|
createdAt | Timestamp of the updload |
extension | File extension |
name | File name |
processed | Processing status |
url | File URL on Lukaz |
Board Options
Property | Description |
---|---|
behavior | Description of the board's behavior |
docs | Documents shown/hidden on board |
free | Prompting free/paid |
prompt | Prompting enabled/disabled |
public | Board access public/private |
upload | File upload enabled/disabled |
voice | alloy, echo, fable, onyx, nova, schimmer |
User Roles
Property | Description |
---|---|
EMAIL_ADDRESS | Email address or session ID |
User Roles Values
Value | Label | Description |
---|---|---|
0 | disabled | No access to the board |
1 | viewer | Access to visible prompts |
2 | prompter | View and submit prompts |
3 | editor | Show/hide prompts |
4 | admin | Upload new documents |
5 | owner | Delete documents |
6 | creator | Delete board |
Board Statistics
Property | Description |
---|---|
docs | Number of documents processed |
prompts | Total number of prompts submitted (by all users) |
results | Number of prompts visible on board |
Get All Boards
This endpoint retrieves all boards that the authenticated user owns or has access to. See getBoards
for a detailed description of a board structure.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const boards = await lukaz.getBoards()
console.log(boards)
curl "https://<BASE_URL>/board"
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
[
{
"createdAt": "2023-01-31T18:10:54.376Z",
"description": "My custom AI board.",
"documents": [
{
"createdAt": "2023-01-31T18:10:54.376Z",
"extension": "pdf",
"name": "Text_File.pdf",
"processed": true,
"url": "https://example.com/Text_File.pdf"
}
],
"id": "<BOARD_ID>",
"ownerEmail": "owner@example.com",
"options": {
"behavior": "Content generator",
"docs": false,
"free": false,
"prompt": true,
"public": false,
"upload": true,
"voice": "onyx"
},
"roles": {
"owner@example.com": 5,
"user@example.com": 4
},
"stats": {
"docs": 2,
"prompts": 7,
"results": 5
},
"title": "My AI Board",
"updatedAt": "2023-01-31T18:10:54.376Z"
}
]
HTTP Request
GET https://<BASE_URL>/board
HTTP Response Body
Property | Description |
---|---|
Board[] | The array of retrieved boards |
Update Board
This endpoint updates a board.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.updateBoard('<BOARD_ID>', {
description: 'My custom AI board.',
notify: true,
options: {
behavior: 'Content generator',
docs: false,
free: false,
prompt: true,
public: false,
upload: true,
voice: 'onyx'
},
roles: {
'user@example.com': 2
},
title: 'My AI Board'
})
curl "https://<BASE_URL>/board/<BOARD_ID>" \
-d '
{
"description": "My custom AI board.",
"notify": true,
"options": {
"behavior": "Content generator",
"docs": false,
"free": false,
"prompt": true,
"public": false,
"upload": true,
"voice": "onyx"
},
"roles": {
"user@example.com": 2
},
"title": "My AI Board"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/board/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to update |
HTTP Request Body
Property | Description |
---|---|
description | Descripton of the board |
notify | Send invite email for new users |
options | Options of the board |
roles | Email addresses with their roles |
title | Title of the board |
Board Options
Property | Description |
---|---|
behavior | Description of the board's behavior |
docs | Documents shown/hidden on board |
free | Prompting free/paid |
prompt | Prompting enabled/disabled |
public | Board access public/private |
upload | File upload enabled/disabled |
voice | alloy, echo, fable, onyx, nova, schimmer |
User Roles
Property | Description |
---|---|
EMAIL_ADDRESS | Email address or session ID |
User Roles Values
Value | Label | Description |
---|---|---|
0 | disabled | No access to the board |
1 | viewer | Access to visible prompts |
2 | prompter | View and submit prompts |
3 | editor | Show/hide prompts |
4 | admin | Upload new documents |
5 | owner | Delete documents |
6 | creator | Delete board |
Delete Board
This endpoint deletes a board.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.deleteBoard('<BOARD_ID>')
curl "https://<BASE_URL>/board/<BOARD_ID>" \
-d '{"deleted": true}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/board/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to delete |
HTTP Request Body
Property | Description |
---|---|
deleted | Deletion flag (boolean) |
Upload File onto Board
This endpoint uploads a file onto a board.
Supported formats: pdf, doc, docx, jpg, png, txt, md
Max file size: 50MB
import FormData from 'form-data' // npm install --save form-data
import * as fs from 'fs'
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const upload = new FormData()
upload.append('filePath', fs.createReadStream('<ABSOLUTE_FILE_PATH>'))
await lukaz.uploadFile('<BOARD_ID>', upload)
curl "https://<BASE_URL>/file/<BOARD_ID>" \
-F filePath=@Text_File.pdf \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/file/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to upload the file |
HTTP Request Body
Property | Description |
---|---|
filePath | Path of a local text file to upload |
Delete File from Board
This endpoint deletes a file from a board.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.deleteFile('<BOARD_ID>', {
fileName: '<FILE_NAME>',
})
curl "https://<BASE_URL>/file/<BOARD_ID>" \
-d '{"fileName": "<FILE_NAME>"}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/file/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to delete the file from |
HTTP Request Body
Property | Description |
---|---|
fileName | The name of the file to be deleted |
Export Board's Prompts
This endpoint exports the prompts of a board.
Supported formats: pdf, docx
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.download('<BOARD_ID>', {
format: 'pdf',
includePrompts: true,
order: 'asc'
})
curl "https://<BASE_URL>/download/<BOARD_ID>" \
-d '
{
"format": "pdf",
"includePrompts": true,
"order": "asc"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
[
{
"fileUrl": "<DOWNLOAD_FILE_URL>"
}
]
HTTP Request
POST https://<BASE_URL>/download/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to export the prompts |
HTTP Request Body
Property | Description |
---|---|
format | pdf, docx |
includePrompts | Include the input of every prompt |
order | asc, desc |
HTTP Response Body
Property | Description |
---|---|
fileUrl | The URL of the generated file |
Prompts
Get Prompt Transcript
This endpoint transcripts the text from an audio file hosted on the web or locally.
Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm
Max file size: 5MB
import FormData from 'form-data' // npm install --save form-data
import * as fs from 'fs'
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const audioFile = new FormData()
audioFile.append('filePath', fs.createReadStream('<ABSOLUTE_FILE_PATH>'))
const {transcript} = await lukaz.getTranscript('<BOARD_ID>', audioFile)
console.log(transcript)
curl "https://<BASE_URL>/transcript/<BOARD_ID>" \
-F filePath=@Audio_File.mp3 \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
{
"transcript": "This is the text from the audio file."
}
HTTP Request
POST https://<BASE_URL>/transcript/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to submit a prompt |
HTTP Request Body
Just one of the properties is required.
Property | Description |
---|---|
audioUrl | URL of a hosted audio file |
filePath | Path of a local audio file |
HTTP Response Body
Property | Description |
---|---|
transcript | The text extracted from the audio |
Submit Prompt to Board
This endpoint submits a prompt to a board. On the dev environment, it will return just a test result.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const result = await lukaz.prompt('<BOARD_ID>', {
instruction: {
includeDocs: true,
includeResults: true
},
prompt: 'What is this board about?',
translateResult: false,
model: 'gpt-4'
})
console.log(result)
curl "https://<BASE_URL>/prompt/<BOARD_ID>" \
-d '
{
"instruction": {
"includeDocs": true,
"includeResults": true
},
"prompt": "What is this board about?",
"translateResult": false,
"model": "gpt-4"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
[
{
"result": "This board is about AI.",
"prompt": "What is this board about?",
"promptId": "<PROMPT_ID>",
"sensitive": false
}
]
HTTP Request
POST https://<BASE_URL>/prompt/<BOARD_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to submit a prompt |
HTTP Request Body
Property | Description |
---|---|
instruction | Instruction object (see bellow) |
model | LLM to be used: gpt-3/4, dall-e-2/3 |
prompt | Text of the user's prompt to submit |
sessionId | Session ID of the user |
translateResult | Result language same as prompt's |
Instruction
Property | Description |
---|---|
editId | Prompt ID to be edited |
includeDocs | Include board documents into context |
includeResults | Include board results into context |
language | Programming language of the result |
qty | Maximum quantity to generate |
resultDescription | Description of the desired result |
resultSample | Examples of the desired result |
HTTP Response Body
The response body is an array of results:
Property | Description |
---|---|
prompt | Prompt submitted to the board |
promptId | Unique ID of the prompt submitted |
result | Result generated for the prompt submitted |
sensitive | Sensitiveness of the prompt's context |
Get Result Audio
This endpoint generates an audio file from the prompt's result.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const {audioUrl} = await lukaz.getAudio('<PROMPT_ID>', {
format: 'mp3'
})
console.log(audioUrl)
curl "https://<BASE_URL>/audio/<PROMPT_ID>" \
-d '
{
"format": "mp3"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
{
"audioUrl": "https://example.com/Audio_File.mp3"
}
HTTP Request
POST https://<BASE_URL>/audio/<PROMPT_ID>
URL Parameters
Parameter | Description |
---|---|
PROMPT_ID | The ID of the prompt to generate the audio |
HTTP Response Body
Property | Description |
---|---|
format | mp3, opus, aac, flac |
Get Prompt
This endpoint retrieves a prompt.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const prompt = await lukaz.getPrompt('<BOARD_ID>', '<PROMPT_ID>')
console.log(prompt)
curl "https://<BASE_URL>/prompt/<BOARD_ID>/<PROMPT_ID>" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
{
"audioUrl": "https://example.com/Audio_File.mp3",
"createdAt": "2023-01-31T18:10:54.376Z",
"feedback": 0,
"id": "<PROMPT_ID>",
"original": "This board is about AI.",
"prompt": "What is this board about?",
"result": "An edited prompt result.",
"sensitive": false,
"updatedAt": "2023-01-31T18:10:54.376Z",
"visible": true,
"boardId": "<BOARD_ID>"
}
HTTP Request
GET https://<BASE_URL>/prompt/<BOARD_ID>/<PROMPT_ID>
URL Parameters
Parameter | Description |
---|---|
BOARD_ID | The ID of the prompt's board |
PROMPT_ID | The ID of the prompt to retrieve |
HTTP Response Body
Property | Description |
---|---|
audioUrl | File URL of the result's audio |
createdAt | Timestamp of the creation |
feedback | Feedback from the prompter |
id | Unique ID of the prompt |
original | Original result generated for the prompt |
prompt | Prompt text that was prompted |
result | Result edited by the user |
sensitive | Sensitiveness of the prompt |
updatedAt | Ttimestamp of the last update |
visible | Status of the prompt on board |
boardId | ID of the prompt's board |
Get All Prompts
This endpoint retrieves all prompts of a board or made by the user. See GET prompt
for a detailed description of a prompt structure.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const prompts = await lukaz.getPrompts('<BOARD_ID>')
console.log(prompts)
curl "https://<BASE_URL>/prompt/<BOARD_ID>" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
[
{
"audioUrl": "https://example.com/Audio_File.mp3",
"createdAt": "2023-01-31T18:10:54.376Z",
"feedback": 0,
"id": "<PROMPT_ID>",
"original": "This board is about AI.",
"prompt": "What is this board about?",
"result": "An edited prompt result.",
"sensitive": false,
"updatedAt": "2023-01-31T18:10:54.376Z",
"visible": true,
"boardId": "<BOARD_ID>"
}
]
HTTP Request
GET https://<BASE_URL>/prompt/<BOARD_ID>
URL Parameters
If <BOARD_ID>
is not provided, then the prompts made by the user are retrieved.
Parameter | Description |
---|---|
BOARD_ID | The ID of the board to retrieve the prompts |
HTTP Response Body
Property | Description |
---|---|
Prompt[] | The array of retrieved prompts |
Update Prompt
This endpoint updates some of the prompt's properties.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.updatePrompt('<PROMPT_ID>', {
feedback: 1,
result: 'An edited prompt result.',
saved: false,
visible: true
})
curl "https://<BASE_URL>/prompt/<PROMPT_ID>" \
-d '
{
"feedback": 1,
"result": "An edited prompt result.",
"saved": false,
"visible": true
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/prompt/<PROMPT_ID>
URL Parameters
Parameter | Description |
---|---|
PROMPT_ID | The ID of the prompt to update |
HTTP Request Body
Property | Description |
---|---|
feedback | 0 (bad) or 1 (good) |
result | Result edited by the user |
saved | Save/remove prompt from favourites |
visible | Show/hide prompt on board |
Delete Prompt
This endpoint deletes a prompt.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.deletePrompt('<PROMPT_ID>')
curl "https://<BASE_URL>/prompt/<PROMPT_ID>" \
-d '
{
"deleted": true
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/prompt/<PROMPT_ID>
URL Parameters
Parameter | Description |
---|---|
PROMPT_ID | The ID of the prompt to delete |
HTTP Request Body
Property | Description |
---|---|
deleted | Deletion flag (boolean) |
Instructions
Create Instruction
This endpoint creates a new instruction for the user.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const instruction = await lukaz.createInstruction({
includeDocs: false,
includeResults: false,
qty: 4,
resultDescription: 'Short social media post with emojis',
resultSample: '😻 Can\'t get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕'
})
console.log(instruction)
curl "https://<BASE_URL>/instruction" \
-d '
{
"includeDocs": false,
"includeResults": false,
"qty": 4,
"resultDescription": "Short social media post with emojis",
"resultSample": "😻 Cant get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
{
"instructionId": "<INSTRUCTION_ID>"
}
HTTP Request
POST https://<BASE_URL>/instruction
HTTP Request Body
Property | Description |
---|---|
edit | Enable edit mode (replace old result) |
includeDocs | Include board documents into context |
includeResults | Include board results into context |
language | Programming language if applicable |
qty | Maximum quantity to generate |
resultDescription | Description of the desired result |
resultSample | Example of the desired result |
HTTP Response Body
Property | Description |
---|---|
instructionId | Unique ID of the instruction created |
Get Instruction
This endpoint retrieves an instruction.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const instruction = await lukaz.getInstruction('<INSTRUCTION_ID>')
console.log(instruction)
curl "https://<BASE_URL>/instruction/<PROMPT_ID>" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
{
"id": "<INSTRUCTION_ID>",
"includeDocs": false,
"qty": 4,
"resultDescription": "Short social media post with emojis",
"resultSample": "😻 Cant get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕"
}
HTTP Request
GET https://<BASE_URL>/instruction/<INSTRUCTION_ID>
URL Parameters
Parameter | Description |
---|---|
PROMPT_ID | The ID of the instruction to retrieve |
HTTP Response Body
Property | Description |
---|---|
id | Unique ID of the instruction |
edit | Enable edit mode (replace old result) |
includeDocs | Include board documents into context |
language | Programming language if applicable |
qty | Maximum quantity to generate |
resultDescription | Description of the desired result |
resultSample | Example of the desired result |
Get All Instructions
This endpoint retrieves all instructions created by the user. See GET instruction
for a detailed description of a instruction structure.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
const instructions = await lukaz.getInstructions()
console.log(instructions)
curl "https://<BASE_URL>/instruction" \
-H "x-api-key: <API_KEY>" \
-X GET
HTTP Response Body:
[
{
"id": "<INSTRUCTION_ID>",
"includeDocs": false,
"qty": 4,
"resultDescription": "Short social media post with emojis",
"resultSample": "😻 Cant get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕"
}
]
HTTP Request
GET https://<BASE_URL>/instruction
HTTP Response Body
Property | Description |
---|---|
Instruction[] | The array of retrieved instructions |
Update Instruction
This endpoint updates some of the instruction's properties.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.updateInstruction('<INSTRUCTION_ID>', {
includeDocs: false,
qty: 4,
resultDescription: 'Short social media post with emojis',
resultSample: '😻 Can\'t get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕'
})
curl "https://<BASE_URL>/instruction/<INSTRUCTION_ID>" \
-d '
{
"includeDocs": false,
"qty": 4,
"resultDescription": "Short social media post with emojis",
"resultSample": "😻 Cant get enough of cute cats? Follow our page for daily dose of furry purr-fection that will melt your heart! 🐈💕"
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/instruction/<INSTRUCTION_ID>
URL Parameters
Parameter | Description |
---|---|
INSTRUCTION_ID | The ID of the instruction to update |
HTTP Request Body
Property | Description |
---|---|
edit | Enable edit mode (replace old result) |
includeDocs | Include board documents into context |
language | Programming language if applicable |
qty | Maximum quantity to generate |
resultDescription | Description of the desired result |
resultSample | Example of the desired result |
Delete Instruction
This endpoint deletes an instruction.
import client from '@lukaz/client'
const lukaz = new client('<API_KEY>')
await lukaz.deleteInstruction('<INSTRUCTION_ID>')
curl "https://<BASE_URL>/instruction/<INSTRUCTION_ID>" \
-d '
{
"deleted": true
}' \
-H "x-api-key: <API_KEY>" \
-X POST
HTTP Response Body:
true
HTTP Request
POST https://<BASE_URL>/instruction/<INSTRUCTION_ID>
URL Parameters
Parameter | Description |
---|---|
INSTRUCTION_ID | The ID of the instruction to delete |
HTTP Request Body
Property | Description |
---|---|
deleted | Deletion flag (boolean) |
Errors
Lukaz API uses the following error codes:
Code | Meaning |
---|---|
400 | Bad Request - Request has malformed syntax. |
401 | Unauthorized - Your API key is wrong. |
402 | Unauthorized - Subscription quota exceeded. |
403 | Forbidden - You don't have access to the resource. |
404 | Not Found - The specified resource could not be found. |
405 | Method Not Allowed - Request has an invalid method. |
413 | Payload Too Large - The file size exceeds the maximum. |
415 | Unsupported Media Type - The file extension is not supported. |
429 | Too Many Requests - Too many requests at the same time. |
500 | Internal Server Error - We had a problem with our server. |
503 | Service Unavailable - We're temporarily offline for maintenance. |