400 Bad Request Using API

Szia!

Próbálok egy API-kérést elküldeni a Discourse-hoz, de mindig hibát kapok. Ez a kód, amit küldök:

{
  "title": "Teszt cím",
  "raw": "Ez csak egy próba, hogy működik-e."
}

A válasz mindig ez: 400 Bad Request. Nem tudom, mi a baj.

Korábban írtam egy hosszú bejegyzést ide, de azt elrejtették, mert tele volt furcsa jelekkel (), és nem voltak benne sortörések. Meg említettem az e-mail címemet is, amit nem szabad. Most már tudom, hogy ezt nem lehet.

Hogyan írjam meg jól a kérést? Miért nem megy? Lehet, hogy a formázás rossz?

Köszönöm a segítséget előre is! :blush:

1 Like

Please also include e.g. the endpoint and how you’re authenticating - provide enough detail so that we know everything about what you’re doing (except of course private content or actual authentication keys)

For example: maybe you’re trying to create a topic, or maybe edit one? Not sure.

First of all read through Discourse REST API Documentation, then you can browse the endpoint documentation for the task you’re trying to accomplish; for instance, here is how to create a new topic.

3 Likes

The first post in this topic didn’t mention the Discourse AI plugin. Is this about the same problem or a different one?

Did you do that?

Sorry for the confusion – the initial post was part of a broader troubleshooting session that started with API key issues and evolved into this plugin integration problem. It’s the same overall issue: trying to set up xAI Grok in the Discourse AI plugin.

Regarding the logs: Yes, I checked /admin/logs after attempting to save/test the LLM config. Here’s what I found [insert relevant log entries here, e.g., “500 - undefined method ‘test_connection’ for nil:NilClass” or “Error: Connection refused to localhost:8000” – if none, say “No specific entries related to the AI plugin error, only general access logs”]. If there’s a better place to look (e.g., specific container logs in Docker), let me know!

For completeness, my Discourse version is [insert, e.g., 3.3.0.beta2 from /admin/upgrade], AI plugin version is [insert, e.g., from admin/plugins or GitHub commit], OS is Ubuntu 22.04 in Docker.

Any ideas on why the “Internal Server Error” happens with this LiteLLM proxy setup? Thanks!

As long as you don’t fill in the placeholders, this conversation makes little sense to me.

I’m not a computer scientist, and I have no idea what I’m doing. I just know where I want to go. I completely rely on Claude AI, Grok AI, Gemini AI, and Chat GPT AI. I work mainly with Claude AI. It describes step by step what to type in the terminal / my PC is Debian 12 / I take a screenshot step by step and upload it to it. If I get stuck on a problem, I copy-paste the information to the other AIs, then I type the ideas to Claude. This almost always helps. I rented a virtual server and installed Docker and Discourse on it. The plan is a system that remembers everything, never gets out of context, with the participation of four / or even more / AIs. The plan is to save our conversations in a searchable way on the Discourse forum. Essentially, the conversations that are in the sidebar on the AIs’ website are added to Discourse. And in Discourse you see all the conversations at once. This is my theory, I don’t know if practice confirms the theory yet because here on the threshold, before entering, we fell apart. Everything went smoothly, but we had trouble with the handling of the Discourse API. We’ve been struggling with it for a week now. There’s always some error, always something different. I apologize for asking the AIs to write an entry on Discourse, but I only speak Hungarian and as I said, I have no idea what I’m doing, only where I want to get to.

You can find the logs by adding /logs to your forums url. For example https://www.enit.hu/logs

1 Like

We found it Thank you

Here on Meta, posts in other languages are translated to the user’s language. If you’re not fluent in English, you can write in Hungarian and the post would be translated :slight_smile:

Also, please don’t hesitate to ask if you’re unsure!

1 Like

Ei aivan. Minä voin kirjoittaa suomeksi (joka sattuneesta syystä on aivan yhtä vaikea ja pieni kieli kuin unkari), mutta se ei käänny kaikille kielille. Se kääntyy vain kouralliselle valtakieli.

Joten minun on edelleenkin pakko osata englantia, saksaa, espanjaa… mitkä tuetut kielet olivatkaan, koska en voi lukea suomeksi, tai unkariksi.

1 Like

Veering into off topic territory here, but to clarify, yes, Hungarian and Finnish are not among the languages that are supported here on meta for automatic translation. You can see the supported languages in the language picker in the top right corner. If you want to talk more about the automatic translation here on meta, start a topic in Site feedback.

@Enit I am super impressed with the initiative you are showing to try to get Discourse set up and configured to do all this. It’s a tremendous experiment! Please keep us informed as you move along. It would be amazing if you could write up how you did it in more detail once you have it all set up.

I know some other members here are using AI on their own sites, but I am not sure who they all are. We use AI very actively here on meta, but that initiative is led by others and I am not intimately familiar with how it is configured. I’d like to, but I also haven’t taken the time yet to set it up and start experimenting with it on other sites I maintain.

Perhaps we need a new topic in Community to congregate and just talk about the various ways people are trying to use AI in Discourse and how it’s working out for them, beyond just the technical details.

Looks like you’ve figured out how to translate yourself for participating here which is great, and you are not writing posts anymore that look like AI hallucinations! :rofl: Just remember to stay on topic and to start new topics for new questions, and that short, clear posts are going to be easier for others to read so they can help you.

822 / 5 000

I documented the entire Common Memory project, including the dead ends. When I get to the end, I’ll be happy to share my experiences with anyone. I think Discourse is a suitable tool for this purpose. We still need to work on API management. Discourse can’t solve this alone, we need to work closely with AI tech companies. The development is explosive, API, tokens, different levels of access, models that appear quickly and disappear just as quickly. But I think it’s worth the work. A new market for Discourse. As a single person, I would like to use Discourse with four AIs. BUT I think it can open up amazing perspectives for families or small communities. So when I get to the end and the thing is polished, I’ll be happy to share my experiences. I’ve already accumulated 120 Mb of Google documents. Off topic bocs.