# Lib Developers

{% hint style="info" %}
This page is only for library developers.\
API users need to use the endpoints listed in the sidebar.
{% endhint %}

Here is what an API client lib should look like.

The http client should always include an `Authorization` header for every request and an optional header for `User-Agent` to show the library name or project/bot name.

![](/files/kgXxaT0n70NsIslixDtP)\
The base class should be FluxpointClient with a category for each types of endpoints to use.\
So this should be used by users like `Client.Test.GetTestImage()` or `Client.Sfw.GetNeko()`\
\
You should also include a TestAuthentication() method so the user can check if they are authenticated properly.

### Send Request Method

You should create a main SendRequest() method that can be used for all endpoints.\
![](/files/Ga1M11XSIlA4HLaLzr5P)\
This will include the HttpMethod (get/post) ApiType (Fluxpoint/Gallery) Path (Endpoint to use) Content (Optional body content this should include string/json support.\
\
The output response you recieve should include the default response of success, code and message and any optional data from the endpoint you use.

### Image Gen Method

This should be the same as Send Request but the response you get will contain raw image data (bytes) that you should handle.

{% hint style="info" %}
Some http clients/libs may require sending a <mark style="color:yellow;">POST</mark> request to use json body.
{% endhint %}

### Endpoints

All endpoints need to have a category so that users can find them easily.\
\
You can use the `SendRequest()` method to send a <mark style="color:green;">GET</mark> request to `https://api.fluxpoint.dev/me`\
![](/files/IGcoOBH4Gz2D9fqp9v6o)\
Users should then be able to use this with `Client.Misc.GetMeAsync()`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fluxpoint.dev/api/client/lib-developers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
